hi. i have two variables which are AREA and PERIMETER.
1 view (last 30 days)
Show older comments
how to save both variables in a mat.file? i only have coding for one variable only :
_ _ _objArea = objMeasurements(k).Area; % Get area.
AREA=[objArea;AREA];
save('AREA.mat','AREA');
objPerimeter= objMeasurements(k).Perimeter; % Get perimeter.
PERIMETER=[objPerimeter;PERIMETER];
save('PERIMETER.mat','PERIMETER');___
1 Comment
Accepted Answer
Walter Roberson
on 13 Oct 2015
save(Filename, 'AREA', 'PERIMETER')
3 Comments
Walter Roberson
on 15 Oct 2015
You can specify a folder name when you save().
To save both values as columns in a single variable:
AREA_PERIMETER = [AREA, PERIMETER];
save(Filename, 'AREA_PERIMETER');
More Answers (1)
Stephen23
on 13 Oct 2015
You could do this in two calls:
save(filename,'AREA')
... other code
save(filename,'PERIMETER','-append')
OR in one call:
save(Filename, 'AREA', 'PERIMETER')
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!