[GRASS5] new module: r.in.mat
hamish_nospam at yahoo.com
Mon Mar 29 10:19:28 EST 2004
I've just added a new module named r.in.mat for importing maps from
Matlab or Octave. This is the companion module to r.out.mat which I
added last week. Most of the caveats there apply here as well.
[Correction from that email: use imagesc(map_data) not image(map_data)]
Here's the help & header comments:
Import a binary MAT-File(v4) to a GRASS raster.
r.in.mat [-v] input=name [output=name]
-v Verbose mode
input Name of an existing MAT-File(v4)
output Name for the output raster map (override)
* FILE MUST CONTAIN THE FOLLOWING MATRIX :
* map_data with the map data
* AND OPTIONALLY :
* map_name name for new map (max 64 chars, normal rules apply)
* map_title contains map title (max 40 chars)
* THESE MUST BE PRESENT UNLESS USING THE "XY" PROJECTION :
* map_southern_edge in decimal form (ie not DDD:MM:SS)
* ALL OTHER MATRICES WILL BE PASSED OVER. (cleanly, I hope)
* tip: Save a version 4 MAT-File with the command:
* "save filename.mat map_* -v4"
The program works for me, but testing would be nice esp. on something
big endian or 64bit.
The speed & ease of matrix algebra in Matlab is pretty extraordinary,
& these two modules make for quick & easy GRASS->Matlab->GRASS trips.
In addition, it makes for a nice binary container format for
transferring maps around that other free software can read, even if
you don't use Matlab or Octave.
Shall I add these to 5.7?
More information about the grass-dev