How to use num2str and disp command?

Here's the question I got from lecture,
Find the help pages for num2str and disp.
Given >>speedlimit = 5;
Write a line of code that displays the message “The local speed limit is speedlimit km/h”, inserting the value where indicated.
How can I display those line only using num2str and disp command?

1 Kommentar

Star Strider
Star Strider am 9 Feb. 2017
Quoting the assignment:
Find the help pages for num2str and disp.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 11 Feb. 2017

0 Stimmen

This
Find the help pages for num2str and disp.
means:
doc num2str
doc disp
You can concatenate strings like this:
['Hi ', 'I am ', 'here']

Kategorien

Mehr zu Debugging and Analysis finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 9 Feb. 2017

Beantwortet:

Jan
am 11 Feb. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by