Scripts with input and output, MATLAB Programming

Scripts with Input and output:

Placing all this together, we can implement the algorithm from the starting of this section. The following script computes and prints the area of a circle. At first it prompts the user for a radius, reads the radius, and then computes and prints the area of the circle based on this radius.

 

967_Scripts with Input and output.png

Executing the script generates the output as shown below:

>> script2

Now enter the radius: 3.9

For the circle with radius of 3.90, the area is 47.78

Note that the output from the first two assignment statements is suppressed by putting the semicolons at the end. That is often completed in scripts; therefore the exact format of what is displayed by the program is controlled by the fprintf functions.

Posted Date: 10/18/2012 5:57:02 AM | Location : United States







Related Discussions:- Scripts with input and output, Assignment Help, Ask Question on Scripts with input and output, Get Answer, Expert's Help, Scripts with input and output Discussions

Write discussion on Scripts with input and output
Your posts are moderated
Related Questions
1. Enter the 3×4 matrix Let a ij denote the entry of A in the ith row and jth column. Use Matlab to compute the following : (a) a 13 + a 32 (b) Three times the

Explain how the wavelet transform based on the real biorthogonal "decomposition" wavelet bior 1.5 (the wavelet shape by typing waveinfo ('bior') at the MATLAB command prompt) can

Plot way forms for the following modulation schemes using Matlab: a)      2 ASK                     b)  BFSK                                  c) BPSK          4 ASK

1. Given these sinusoids: x 1 (t) = 0.5cos(25t+20°),   x 2 (t)=0.85cos(25t+160°) and   x 3 (t)= 0.81cos(25t-145°) (a)  Subplot the phasors X 1 , X 2 and X 3 corresponding t

A. Introduction The project consists of two parts. In the first part you are asked to perform some preliminary calculation and plotting, and to write the introduction for your

Savannah says that the least common multiple of 4 and 6 is 24. Is she right or what is her mistake?

Looping Statements: Consider the problem of computing the area of a circle with radius of 0.3 centimeters-a MATLAB program certainly is not required to do that; you would use

Goal: Learn how to do statistics, sorting and curve fitting in Matlab. Put all of those ".m" files in a folder called yourname_lab7, and zip the folder and submit it on the class w


Referring to and Modifying Elements: The particular element in a vector is accessed by using the name of the vector variable and the element number (or subscript, or index) in