As the following code shown, there will always be an error saying "Unexpected MATLAB expression" for the first "num2str" in the row defining filename. Please, help me!!!
WeChat Screenshot_20190114165317.png

 採用された回答

Star Strider
Star Strider 2019 年 1 月 15 日

1 投票

The ‘filename’ assignment in your code is not the correct syntax.
It should be:
filename = ['A',num2str(kk),'.dat'];
Note the square brackets [], and not parentheses ().
However, using the sprintf function is preferable:
filename = sprintf('A%d.dat', kk);
I would use that instead.

2 件のコメント

Yingjie Cheng
Yingjie Cheng 2019 年 1 月 15 日
Problem solved. Thank you so much!!
Star Strider
Star Strider 2019 年 1 月 15 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by