How to assign column headings to .mat file?

22 Ansichten (letzte 30 Tage)
hema purad
hema purad am 4 Okt. 2022
Bearbeitet: Ajai Singh am 4 Okt. 2022
I have some statiscal measures such as mean, medan, standard devation calculated on 1000 images and there is one row for each image hence there are 1000-by-3 data is generated for image database and I have stored this data as .Mat file. and I would like to add column headings ,(mean, median, standard deviation) to that "mat file" so that, I can access data by column headings for further calculations.. Kindly help me in this regard.
Thanking You.
  1 Kommentar
Ajai Singh
Ajai Singh am 4 Okt. 2022
Bearbeitet: Ajai Singh am 4 Okt. 2022
You can probably try this : ( assuming the name of your mat file is MyData and variables mean median and standard_deviation have their respective values)
a.mean = mean;
a.median = median;
a.standard_deviation = standard_deviation;
save( ' MyData.mat ' ,' a ' );
Load this mat file and use dot notation to extract the values;
ImageData = load( ' MyData.mat ' );
Now suppose that you want to extract the mean, the following line will help you to do that :
ImageData.mean

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Walter Roberson
Walter Roberson am 4 Okt. 2022
It is not possible to add column headings to a mat file.
However you can create a table() object and store it in the mat file.

Nicole
Nicole am 4 Okt. 2022
It might be helpful to save the data into a structure, where you can assign field names. In this way, you could make mean, median, and standard deviation be your fields, and index them as such. MATLAB structures can be saved as .mat files.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by