How to store variable name AND value in an array?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Suppose I have some code which produces the following outputs:
density = 456
pressure = 356
temperature = 66
How can I store these variables and their names in an array to save them from being printed in the terminal for example?
0 Kommentare
Akzeptierte Antwort
Chunru
am 26 Aug. 2022
density = 456;
pressure = 356 ;
temperature = 66;
% or use struct
a.density = 456;
a.pressure = 356 ;
a.temperature = 66;
0 Kommentare
Weitere Antworten (1)
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!