how to print an array values and save the values in .mat file.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Umer
am 22 Sep. 2015
Beantwortet: Star Strider
am 22 Sep. 2015
for i=1:10
j(i)=i*5:
end
output will be:
5,
10,
......
50.
how to print the j(i) array and save it to .mat file?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 22 Sep. 2015
Printing them is relatively straightforward:
for i=1:10
j(i)=i*5;
end
fprintf('%.0f,\n', j)
Saving is as easy:
save('j.mat', 'j')
Call the file anything you want. I called it ‘j.mat’. Be sure to keep the single quotes around the file name and the variables you want to save to it. (The save call I did not specifically test, but should work.)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT-Files 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!