For Programmers: Free Programming Magazines  


Home > Archive > Matlab > April 2005 > how to do a printf and a scanf in matlab?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to do a printf and a scanf in matlab?
Dave

2005-04-27, 4:03 pm

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, 4:03 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com