Effacer les filtres
Effacer les filtres

saving with variable name

2 vues (au cours des 30 derniers jours)
Sanjana Sankar
Sanjana Sankar le 30 Juil 2019
Commenté : Sanjana Sankar le 30 Juil 2019
I want to call a function twice. And this function has to save a mat file. So each time it is callled, I want to send a variable name that it must use as the name of the .mat file.
For example:
function mat_fil=(filename)
{ C = cells that i want to save;
save(filename.mat, 'C');
}
end
How do I do this?

Réponse acceptée

Alex Mcaulley
Alex Mcaulley le 30 Juil 2019
function myfun(filename,C)
save([filename '.mat'], 'C');
end
  1 commentaire
Sanjana Sankar
Sanjana Sankar le 30 Juil 2019
Thanks! Got it

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by