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

ANFIS, How to design a FIR filter using ANFIS in MATLAB

How to design a FIR filter using ANFIS in MATLAB

A matlab program to produce a map of the route, Micro-mouse is an engineeri...

Micro-mouse is an engineering design competition created by IEEE in the late 1970s. Small robotic "mice" solve a 16x16 cell maze. The mice are completely autonomous and must find t

#GUI, #create a matlab GUI for designing common emitter amplifier which pro...

#create a matlab GUI for designing common emitter amplifier which produces AC load lines based on the component values

Root ?nding using the bisection method, In many applications, including ?na...

In many applications, including ?nancial mathematics, ?nding zeros of a function f(x) = 0 (4) is paramount. One of the simplest method is the Bisection Method. The bisection

Format function and ellipsis, The Format Function and ellipsis: The de...

The Format Function and ellipsis: The default in MATLAB is to show numbers which have decimal places with four decimal places. The format command can be used to identify the o

Find divergence of the 2-d vector field, 1. Assume that there exists a surf...

1. Assume that there exists a surface that can be modeled with the equation:  z = e-(x 2 + y 2 ).  a) Calculate ∇z at the point (x = 0, y = 0). b) In addition, use MATLAB to

Median, what are the steps we need to write in the script to get themedian ...

what are the steps we need to write in the script to get themedian for X values

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