Effacer les filtres
Effacer les filtres

Writing to .mat files

2 vues (au cours des 30 derniers jours)
Victor
Victor le 26 Juin 2014
Réponse apportée : dpb le 26 Juin 2014
I have created a function like so:
func(a,b,c,d)
and inside the function I will create a variable matrix where the function will fill the matrix like so:
1 b c d
2 b c d
3 b c d
4 b c d
I want to write these values to a .mat file let's say test.mat. However in test.mat, there can be more than one variable matrix. The user will input the first matrix called x and that will be in test.mat. The user can also input a different matrix y and that will also be in test.mat. So basically i want to be able to add different matrices in test.mat without affecting the other matrices in test.mat.

Réponses (1)

dpb
dpb le 26 Juin 2014
See
doc save
especially the -append keyword. You'll find using the command form of the function call much more amenable to deal with variable names than otherwise.

Catégories

En savoir plus sur Files and Folders 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