hi ,i m sudheer suraparaju.......studying mtech first year in nit durgapur........under the branch telecommunications.......this blog is a result of my endeavour for matlab..........i think to start matlab, some basic stuff is needed .........and i m starting my blog articles with a very basic stuff..........the basic functions that i m going to discuss in this article r
1.input
2.disp
as the name input suggests it is some function which takes input from the user..........so when the function input is used then the computer is able to ask the input from the user.........see the code bellow:
age=input('enter ur age');
here the input function accepts the age and it keep the value in the variable 'age'
if i want to see what is there inside this variable age.........then the function that outputs the value inside the age is 'disp'
so if i type disp(age);
then it gives the value inside the age.............thats it when i want to work with strings.............
name=input('enter ur name','s');
disp(name);
this will output the string inside the variable name.......thats it .............
that is when u want to work with strings.....just use 's'
just remember that for the arguments inside the input we should use ' ' but for the disp function there is no need to use those inverted commas.................
No comments:
Post a Comment