フィルターのクリア

save string in matfile

16 ビュー (過去 30 日間)
Elysi Cochin
Elysi Cochin 2013 年 1 月 2 日
t1='J for Java';
t2='M for Matlab';
t3='C for cobol';
t4='F for FORTRAN';
can i store strings into a matfile.... if possible how to store these values in a matfile....
text=[t1; t2; t3; t4];
save Matfiletext text
when i did like this error....
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
Error in ==> Plantmatfile at 11
text=[t1; t2; t3; t4];
  1 件のコメント
Image Analyst
Image Analyst 2013 年 1 月 2 日
Don't use text as the name of your variable. That is reserved for a built in function of the same name. If you do use that name, you'll destroy the built in function. Call it something like listOfLanguages or languangeMenu or something more descriptive like that.

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 1 月 2 日
編集済み: Azzi Abdelmalek 2013 年 1 月 2 日
text={t1; t2; t3; t4};
save Matfiletext text
%You can't concatenate vertically t1 and t2, because their size are different, but it's possible in cell array
%to get t1 and t2 use
t1=text{1}
t2=text{2}
% Or you can use
t1='J for Java';
t2='M for Matlab';
t3='C for cobol';
t4='F for FORTRAN';
text=char(t1,t2,t3,t4)
%to get t1 use
t1=strtrim(text(1,:))
  1 件のコメント
Elysi Cochin
Elysi Cochin 2013 年 1 月 2 日
thank u sir....

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFortran with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by