Ho to convert .mat to an vektor?

14 views (last 30 days)
Beginner
Beginner on 18 Jun 2018
Edited: Ameer Hamza on 18 Jun 2018
A .mat file with 100 variables each has one value.
I Need a vector with this 100 values and in bestcase an arrey with the variables names.
Thanks

Answers (1)

Ameer Hamza
Ameer Hamza on 18 Jun 2018
Edited: Ameer Hamza on 18 Jun 2018
Here is a solution
s = load('filename.mat');
this will create a single struct with variable name as filed names. To obtain a vector
Vector = struct2array(s);

Community Treasure Hunt

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

Start Hunting!