Illustrations of if statement, MATLAB Programming

Illustrations of if statement:

illustrations of running this script:

>> sqrtifexamp

Please enter a number: -4.2

The sqrt of 4.2 is 2.0

>> sqrtifexamp

Please enter a number: 1.44

The sqrt of 1.4 is 1.2

In this situation, the action of the if statement was a single assignment statement.

The action can be several numbers of valid statements. For illustration, we might wish to print a note to the user to state that the number entered was being changed.

959_Illustrations of if statement.png

>> sqrtifexampii

Please enter a number: -25

OK, we will use the absolute value

The sqrt of 25.0 is 5.0

Note that the use of two single quotes in the disp statement in order to print the one single quote.

Posted Date: 10/19/2012 3:16:18 AM | Location : United States







Related Discussions:- Illustrations of if statement, Assignment Help, Ask Question on Illustrations of if statement, Get Answer, Expert's Help, Illustrations of if statement Discussions

Write discussion on Illustrations of if statement
Your posts are moderated
Related Questions
i am doing my project on matlab and the topic of my project is invisible watermarking.How we can extract all pixel values of image in binary form.

(a) Using Matlab, find and plot the magnitude of the DTFT of 10 samples of x(n) for n=[0:1:9] of x(n) = cos(2*pi*f1*n) + cos(2*pi*f2*n)  for f1=0.22 and f2=0.24 and pad zeros to ge

Matlab Programming Vector Algebra : Create a program package for calculation of distances and intersections of lines and planes. Plot the results in a graphical representation

a) Develop and submit a power-based MC "SNR" simulator (derived from the voltage-based SNR program provided in MS Powerpoint file) that: i) Uses the following Input: Time period

Matrices of random numbers: The Matrices of random numbers can be generated using the rand and randint functions. The first two arguments in the randint function identify the

drow midpoint circle for scan converting acircle in matlab

kind in geometric calculity in space AREA. >

How to simulate a robot

Reading from a File: A file has been once created; it can be read into a matrix variable. When the file is a data file, the load function will read from the file filename.ext

Digging the Dirt: Autonomous Mining Robots   Mining is a multi-billion dollar industry and a critical part of the Australian economy. Much of the day-to-day work on mining sites