Example of variables and assignment statements, MATLAB Programming

Example of Variables and assignment statements:

The expression is computed and then that value is stored in the variable. For illustration, this is the way it would appear in the Command Window:

>> mynum = 6

mynum =

6

>> 

Here, the user typed mynum = 6 at prompt, and the MATLAB stored integer 6 in the variable known as mynum, and then exhibit the result followed by the prompt again. As the equal sign is an assignment operator, and it does not mean equality, the statement must be read as 'mynum gets the value of 6' (not 'mynum equals 6').

Note that the variable name should always be on the left, and the expression on the right side. An error will take place if these are reversed.

>> 6 = mynum

??? 6 = mynum

 

Posted Date: 10/18/2012 3:24:14 AM | Location : United States







Related Discussions:- Example of variables and assignment statements, Assignment Help, Ask Question on Example of variables and assignment statements, Get Answer, Expert's Help, Example of variables and assignment statements Discussions

Write discussion on Example of variables and assignment statements
Your posts are moderated
Related Questions
draw midpoint circle by matlab

Scripts to Produce and Customize the Simple Plots: The MATLAB has many graphing capabilities. In most cases, customizing plots are desired and this is the simplest to accompli

the basic equation of modeling radioactive decay is where the amount of the radioactive substance is at time and is the decay rate. Some radioactive substances decay into other rad

Write a script to determine the volume of a pyramid, which is 1/3 * base * height, where the base is length * width. On time the user to enter values for the length, width, and th

Implement a MatLab function to calculate y.  The function should take two input arguments 1) A vector of parameters In the above example this would be of length 3, the first

Need help programming in Matlab for airy equations

1;write a matlab of geuss elimination with scaling and pivoting under consideration?

256789;267825;625892;982895;598289


Format command: The format command can be used to control the spacing between the MATLAB command or expression and the outcome; it can be either compact or loose. >> format