Including comments in a .mat file?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Is there any way to include comments (or similar) in a '.mat' file to indicate what the stored variables are?
0 Commenti
Risposte (3)
Jos (10584)
il 7 Feb 2014
Modificato: Jos (10584)
il 7 Feb 2014
Another option might be to use a structure:
A.values = [21 22 35]
A.label = 'temperature'
A.unit = 'degrees Celsius'
A.comment = 'measured with Pete''s device'
0 Commenti
Azzi Abdelmalek
il 7 Feb 2014
Modificato: Azzi Abdelmalek
il 7 Feb 2014
You can get those information. Look at this example
a=1;
b=2;
c=3;
save filename a b c
clear;
load filename
whos -file filename.mat
%or
data=load('filename')
var_names=fields(data)
4 Commenti
Azzi Abdelmalek
il 7 Feb 2014
You can also create a function for each file you want to load
function filename
% comment1
% comment2
% .....
load filename
To load the file filename just type
filename
To see the comments type
help filename
Bjorn Gustavsson
il 7 Feb 2014
Sure, create a string describing everything, save that string variable.
Vedere anche
Categorie
Scopri di più su Workspace Variables and MAT Files in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!