Illustration of input function, MATLAB Programming

Assignment Help:

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 =

 


Related Discussions:- Illustration of input function

#title.the number of pixels related to the actual phase, #question.i want t...

#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..

Appending data to a data file, Appending data to a data File: A text f...

Appending data to a data File: A text file once exists; the data can be appended to it. The format is similar as formerly, with the addition of the qualifier -append. For illu

ANFIS, how to design a digital fir filter using anfis in matlab.get the cod...

how to design a digital fir filter using anfis in matlab.get the code for that.

Variable number of input arguments - function, Variable number of input arg...

Variable number of input arguments: For illustration, the below function areafori has a variable number of input arguments, either the 1 or 2. The name of the function stands

Sopping function and upwind scheme, I am trying to implement this equation ...

I am trying to implement this equation u_t=-\u_x\ using upwind scheme. and as a second step, I need to put some stopping function g(h) where u_t=-g(h)\u_x\ how can I write this on

Help me..., construct a matlab program to calculate and to plot the electro...

construct a matlab program to calculate and to plot the electron and hole concentration as a function of the Fermi-level in an energy gab of Si at a Given temperature and the carri

Dgdsrgds, Ask question #Mingdfgdfgdfgimum 100 words accepted#

Ask question #Mingdfgdfgdfgimum 100 words accepted#

Temperature dependence of vacancy concentrations, write a computer program ...

write a computer program that will provide a user with the equilibrium concentration of vacancies in a metallic element as a function of temperature.Temperature range should be men

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd