converting a vector entry into string

Hello fellows: I know that this topic (conversion of a number into a string) is very basic one and the syntax for it is num2str. However I am facing an error when trying to convert a number in a vector into string using the following for loop:
for i=1:L-1
display(['k', num2str(i),' = ',num2str(k(i)),' pixels^-1.']);
end
The error is:
Undefined function 'num2srt' for input arguments of type 'double'.
Any help will be appreciated

 采纳的回答

Oleg Komarov
Oleg Komarov 2012-8-3
It appears to be a typo, are you sure that you're using num2str() instead of num2srt()?

1 个评论

yes I am sure because I copy the for loop from the code and pasted it in the question directly

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by