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

Write single MATLAB statements to create these vectors from any vector Z. You can use vector Z shown as a sample input. Create a single m-file script (non-function) to containing a

Vectors and Matrices: The Vectors and matrices are used to store sets of values, all of which are similar type. A vector can either be a column vector or a row vector. The mat

kind in geometric calculity in space AREA. >

Documentation: It is very important that all the scripts be documented well, so that the people can understand what the script does and how it accomplishes that. One way of do

Various commands for get the help: There are various commands which can serve as an introduction to MATLAB and allow you to get the help: info will show contact informatio


Script - MATLAB: The script is a series of MATLAB instructions which is stored in a file and saved. The contents of a script can be showed in the Command Window by using the t

You are asked to create an american option multiplicative binomial model calculator in MatLab. Both put and call options should be valued. Given u, d, S 0 , K, r, and T (the usual

An environmental consulting firm is conducting a site investigation on an abandoned industrial site that is 200 m by 150 m in size (Fig. 1). A number of piezometers were installed