Loading .mat file problem
Ältere Kommentare anzeigen
Hi everyone,
When I uploaded a .mat file to MATLAB, the name of the file appears as "ans" in workspace. Is there any way to correct it? Thanks in advance.

Akzeptierte Antwort
Weitere Antworten (1)
Cameron
am 18 Apr. 2023
It looks like when the .mat file was saved, the variables weren't saved with their proper names. You could just keep it as it is and do this:
load('data_B6_RC.mat');
t = ans(1,:);
vs = ans(2,:);
vc = ans(3,:);
Or you could resave it as
load('data_B6_RC.mat');
t = ans(1,:);
vs = ans(2,:);
vc = ans(3,:);
save('data_B6_RC_new.mat','t','vs','vc')
and just use the data_B6_RC_new.mat file instead. Or you could overwrite the old file.
1 Kommentar
Sazcl
am 18 Apr. 2023
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!