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
Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLAB

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 )

a) Develop and submit a power-based MC "SNR" simulator (derived from the voltage-based SNR program provided in MS Powerpoint file) that: i) Uses the following Input: Time period

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 filter described by the equation:    y(n) = x(n) + x(n-1) + 0.9 y(n-1) - 0.81 y(n-2) (a) Find the transfer function H(z) for the filter and find the poles and zeros of the fil


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

1. Assume that there exists a surface that can be modeled with the equation:  z = e-(x 2 + y 2 ).  a) Calculate ∇z at the point (x = 0, y = 0). b) In addition, use MATLAB to

Need help programming in Matlab for airy equations

how can write a program to make a marksheet of 6 subjects?