Effacer les filtres
Effacer les filtres

condition check from matfile

2 vues (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 2 Jan 2013
i have wanted to store 'value' and 'text' in a matfile....
value=[1; 2; 3; 4];
text=['J for Java';'M for Matlab';'C for cobol';'F for FORTRAN'];
when i try to save them in one matfile error is coming... i tried like this
save MatFilename value text
i wanted to save these values in a matfile... then i have a variable.... if the variables value is 3, i need to check whether that value is in the matfile and if it is in 'value' i need to display the third string from the 'text'
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 2 Jan 2013
The problem is in your text variable, you can't use vertical concatenation with string with different sizes

Connectez-vous pour commenter.

Réponse acceptée

TAB
TAB le 2 Jan 2013
Use,
save('Filename.mat','value','text')

Plus de réponses (1)

Walter Roberson
Walter Roberson le 2 Jan 2013
text=['J for Java';'M for Matlab';'C for cobol';'F for FORTRAN'];
would not be valid. It attempts to create a character array with different number of characters per row. Use {} instead of []
  1 commentaire
Elysi Cochin
Elysi Cochin le 2 Jan 2013
thank u all...

Connectez-vous pour commenter.

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by