converting a vector entry into string

조회 수: 1 (최근 30일)
Said Rahal
Said Rahal 2012년 8월 3일
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
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 3일
what is k? give us for ewample for i=1 what do you want to get

댓글을 달려면 로그인하십시오.

채택된 답변

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
Said Rahal
Said Rahal 2012년 8월 3일
yes I am sure because I copy the for loop from the code and pasted it in the question directly

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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