Azzera filtri
Azzera filtri

How to list variables in save() as an array of strings

9 visualizzazioni (ultimi 30 giorni)
I want to save a list of vars to a mat file, but the list of vars is not known until run time, such as:
vars = ['a', 'b', 'c']; save('fname', vars)
Is this possible?

Risposta accettata

KL
KL il 7 Dic 2017
use a cell array,
vars = {'a','b','c'};
and then,
save('dummy.mat',vars{:})

Più risposte (0)

Categorie

Scopri di più su Cell Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by