필터 지우기
필터 지우기

condition check from matfile

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2013년 1월 2일
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
Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 2일
The problem is in your text variable, you can't use vertical concatenation with string with different sizes

댓글을 달려면 로그인하십시오.

채택된 답변

TAB
TAB 2013년 1월 2일
Use,
save('Filename.mat','value','text')

추가 답변 (1개)

Walter Roberson
Walter Roberson 2013년 1월 2일
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 []

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by