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

The Programming Concept: In most of the programming languages, random function returns a real number; therefore the real number would then have to be rounded to produce a rand

Run the MATLAB script sum = single(0); term = single(1); n=1; while sum + term > sum sum = sum+term; n=n+1; term = 1/n; end n Explain what you think it is trying to do. What wou

kind in geometric calculity in space AREA. >

Two cars started to move from zero position with (φ = 35) as shown. For the next four minutes, do the following: 1. Calculate each car's distance from the zero position (Distanc

Input in a for Loop: The script below repeats the process of prompting the user for a number, and echo printing the number (that means simply printing it back out). A for loop

Using numerical techniques, plot the intensity distribution for LP 01 and LP 11 modes. Vary the value of V (reduce it to 1.5) and plot several of the intensity plots (of LP 01 )

I am doing project "Recognizing people in video based on their body" the system will use MATLAB to detect people based on thier body and then recognize them from their clothes "us