converting a vector entry into string

1 Ansicht (letzte 30 Tage)
Said Rahal
Said Rahal am 3 Aug. 2012
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 Kommentar
Azzi Abdelmalek
Azzi Abdelmalek am 3 Aug. 2012
what is k? give us for ewample for i=1 what do you want to get

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Oleg Komarov
Oleg Komarov am 3 Aug. 2012
It appears to be a typo, are you sure that you're using num2str() instead of num2srt()?
  1 Kommentar
Said Rahal
Said Rahal am 3 Aug. 2012
yes I am sure because I copy the for loop from the code and pasted it in the question directly

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by