Discussion:
how to do a printf and a scanf in matlab?
(too old to reply)
Dave
2005-04-27 16:28:25 UTC
Permalink
Hi, i would like to print a message in the screen, such as:
printf("hi, my name is Dave and im %d",years);

and read values that the user type:

scanf("%d",&years);
Jérôme
2005-04-27 16:37:31 UTC
Permalink
Hi,

help input
help sprintf

try this :

n=input('Name :','s');
a=input('Age');
sprintf('Hi, my name is %s and I''m %d years old',n,a)

Jérôme

Continue reading on narkive:
Loading...