Save matrix created within app designer

3 ビュー (過去 30 日間)
Luis Eduardo Cofré Lizama
Luis Eduardo Cofré Lizama 2020 年 8 月 11 日
コメント済み: Rik 2020 年 8 月 11 日
Hi All, I am trying to save a 1x18 matrix that contains the results of my data processing all whithin the same app designer CallBack function.
The matrix is called Results and I am doing as follows at teh end of all calculations:
fname = strcat ('R',num2str (r),'S',num2str(s),'_results.txt')
save (fname, 'Results','-ascii')
However, when I check the file created it is full of zeros. I copy pasted the same script in the command windows and it works perfectly. Am I missing something? Is there a specific way to do this in app designer? I've already tried a couple of suggestions from teh web, but nothing works.
Cheers
eduardo

採用された回答

Rik
Rik 2020 年 8 月 11 日
If you use fprintf you have full control over the format in which your data is written. I tend to suggest avoiding save/load when dealing with files that aren't in the .mat format.
It shouldn't matter if you are in AppDesigner or not, as long as the inputs are the exact same.
  4 件のコメント
Luis Eduardo Cofré Lizama
Luis Eduardo Cofré Lizama 2020 年 8 月 11 日
Thanks a lot Rik, almost there, just need to figure out how to get a "0.000" format and tab or comma separated values.
Cheers
Eduardo
Rik
Rik 2020 年 8 月 11 日
Look into the documentation of fprintf or sprintf. Those will explain how to create a tab character or get a specific format.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by