Hi,
I have this line in my script and the persisting error is:
save(outname,'d','ml','t','s','SD','aux');
Error using save Argument must contain a string.
Any idea why?
Many thanks!

 採用された回答

Star Strider
Star Strider 2015 年 9 月 22 日

0 投票

You didn’t tell us what ‘outname’ is, but it should be something like:
outname = 'MyFile.mat';
The filename must itself be a string, and it is best if it is specifically declared as a .mat file with the .mat extension to avoid confusion with workspace variable names.

4 件のコメント

LuS
LuS 2015 年 9 月 22 日
Thank you very much for your fast reply. Sorry for this but here it is:
aux = zeros(length(d),8);
t = 0:1/fs:length(d)/fs - 1/fs;
outname = uiputfile('*.nirs','Save .nirs file ...');
fprintf('Saving as %s ...\n',outname);
save(outname,'d','ml','t','s','SD','aux');
Star Strider
Star Strider 2015 年 9 月 22 日
I doubt that’s going to do what you want, which is to return a file name. I would use:
outnamepfx = inputdlg('File name prefix: ', 'Save .nirs file ...', [1 40]);
outname = [outnamepfx{:} '.nirs'];
LuS
LuS 2015 年 9 月 22 日
Thank you very much :)
Star Strider
Star Strider 2015 年 9 月 22 日
My pleasure!
The sincerest form of appreciation here on MATLAB Answers is to Accept the Answer that most closely solves your problem.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

質問済み:

LuS
2015 年 9 月 22 日

コメント済み:

2015 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by