num2str error in converting an integer

2 ビュー (過去 30 日間)
Hugo Silva
Hugo Silva 2021 年 5 月 12 日
編集済み: Hugo Silva 2021 年 5 月 12 日
My code is a lot more complicated, so I'll show just a simplification:
a=0;
while a<4
a=a+1;
disp(['Number=' num2srt(a)])
end
This error message appears: "Undefined function 'num2srt' for input arguments of type 'double'."
I want to convert the number a to string format to display in every cycle, but I can't see where the problem is, especially because I've used num2str with doubles as inputs before, and it didn't gave any error

採用された回答

Walter Roberson
Walter Roberson 2021 年 5 月 12 日
You used the function name num2srt but the real function name is num2str

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by