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
256789;267825;625892;982895;598289

Creating Column Vectors: One way to generate a column vector is by explicitly putting the values in square brackets, separated by the semicolons: >> c = [1; 2; 3; 4] c =

I have couple questions in MATLAB I need help in

how do I make a second main function?

Function Functions: The one reason for using function handles is to be able to pass functions to the other functions-these are known as function functions. For illustration

1. Write a function to threshold your images separating the background from the foreground: Implement the "peakiness" detection algorithm described in class. The output of your

Temperature readings were done every hour (starting at 1 P.M., but the end time could vary) and stored in a vector called readings. Write a function called halffit that receives 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

Illustration of Output statements: For illustration, >> disp('Hello') Hello >> disp(4^3)   64 The formatted output can be printed to the screen by using the fpr

i want to save the values of a particular equation in a for loop.. for ex: for i=1:100 et=(x+yz); end thus how can i store the values of et at each iteration