Illustration of input function, MATLAB Programming

Illustration of Input function:

For illustration,

>> rad = input('Enter the radius: ')

Enter the radius: 5

rad = 5

If character or string input is preferred, 's' should be added after the prompt:

>> letter = input('Enter a char: ','s')

Enter a char: g

letter =

g

Note that though this is a string variable, the quotes are not shown. Though, they are shown in the Workspace Window.

If the user enters only spaces or tabs before pressing an Enter key, they are ignored and the empty string is stored in the variable:

>> mychar = input('Enter a character: ', 's')

Enter a character:

mychar =

''

Note that in this case the quotes are shown, to elaborate that there is nothing inside of the string.

Though, if the blank spaces are entered before other characters, they are involved in the string. In this illustration, the user pressed the space bar four times before entering the 'go':

>> mystr = input('Enter a string: ', 's')

Enter a string:     go

mystr =

  go

>> length(mystr)

ans =

 

Posted Date: 10/18/2012 5:48:15 AM | Location : United States







Related Discussions:- Illustration of input function, Assignment Help, Ask Question on Illustration of input function, Get Answer, Expert's Help, Illustration of input function Discussions

Write discussion on Illustration of input function
Your posts are moderated
Related Questions
Write single MATLAB statements to create these vectors from any vector Z. You can use vector Z shown as a sample input. Create a single m-file script (non-function) to containing a

clear tic L=1; T=0.2; nust=2000; dt=T/nust; n=40; dx=L/n;   r=1;  omega=10:10:5000;%Store Range of Frequencies for Simulation u=zeros(n+1,nust+1);%

i need help with a monte carlo simulation. I have most of the code, but I can''t get it to plot correctly

cAN Can I learn Metlab .I am X Scientist in DigitalCommunication. Can U please help me.I know the programming concepts

Input Function: The Input statements read in values from the default or standard input device. In most of the systems, the default input device is the keyboard; therefore the

illustration of for loop: illustration, to print a column of numbers from 1 to 5: for i = 1:5 fprintf('%d\n',i) end   This loop can be entered in the Command Wi

clear clc %% DATA INPUT filename = input('Enter file name, including its extension: ', 's'); D = load(filename); %or load('Mphi.out'); %% %Trendline %Evaluates

#question.i want to know the number of pixels related to the actual phase value and want to separate the zero phase valued pixels from the image..

kind in geometric calculity in space AREA. >

Your functions will allow you to create the following graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and t