arrays - Octave/GRASS GIS .mat import error: 'map_data' undefined -
i have matlab script calculates terrain-parameter (describing theoretical shelter , exposure wind) based on digital terrain model. script works both in matlab , octave , yields matrix. now: trying couple grass gis shell script. can call script grass, have problems getting output grass. 1 way use .mat format. problem is, however: when export result of calculation (with save -mat4-binary result.mat ans
) , try import .mat file grass, error is:
error: no 'map_data' array found in [...file]
similarly, when load file in octave , try display
load result.mat imagesc(map_data), axis equal, axis tight, colorbar
the error
error: `map_data' undefined near line 19 column 9
error: evaluating argument list element number 1
when export matlab, same problem.
where bug?
any appreciated.
the "bug" is, mat-file not contain variable named "map_data", guess variable in mat-file named "ans". use res=load result.mat
, struct in mat file. if type in res.
autocomplete should list variables inside struct (not sure octave), alternatively use fieldnames(res)
list variable names.
/update:
i took short documentation of grass. expects predefined variable names, beginning map_*. instead of
save -mat4-binary result.mat ans
you should rename variables match documentation , save them using
save -mat4-binary result.mat map_*
Comments
Post a Comment