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 =



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

The MATLAB system having of five main parts: * Handle Graphics. * The MATLAB working environment. * The MATLAB language. * The MATLAB mathematical function library.

how do I make a second main function?

Creating Matrix Variables: Creating a matrix variable is actually just a generalization of creating a row and column vector variables. That is, the values within the row are s

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

hey ! why the command sawtooth and square does not exist in Matlab R2012a?

Hello my name is lalitkumar and I am a student.I needed help in MATLAB for recognition of colour randomly using webcam realtime for RGB without external trigger.please mail the co

In many applications, including ?nancial mathematics, ?nding zeros of a function f(x) = 0 (4) is paramount. One of the simplest method is the Bisection Method. The bisection

The characteristic properties of an aquifer can be used to calculate groundwater velocities, v groundwater (L/T), according to: where KH (L/T) is the hydraulic conductivit