how can i deal with .mat file in Matlab?

8 views (last 30 days)

Answers (1)

BobH
BobH on 9 Mar 2020
See load
It will add variables from the mat file to your workspace.
  2 Comments
BobH
BobH on 10 Mar 2020
I'm still uncertain how you want to use .mat files.
It seems you have no .mat files that already exist, so I assume you want to save some of your variables into a .mat file? For example. to save the variable that is created by your call to imageDatastore, use
save( 'savedimds.mat', 'imds');
or to save several variables, keep adding their names to the end of the command, for example
save( 'savedvars.mat', 'imds', 'augmenter', 'options');
To recall from a mat file, use load.
load( 'savedimds.mat' ); % restore saved variable 'imds' from mat

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!