Creating matrix variables, MATLAB Programming

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 separated by either commas or spaces, and the various rows are separated by the semicolons. For illustration, the matrix variable mat is created by explicitly typing the values:

>> mat = [4 3 1; 2 5 6]

mat =

4   3    1

2   5    6

There should always be similar number of values in each row. If you try to generate a matrix in which there are various numbers of values in the rows, the outcome will be an error message; for illustration:

>> mat = [3 5 7; 1 2]

??? Error using ==> vertcat

 

 

Posted Date: 10/18/2012 4:18:52 AM | Location : United States







Related Discussions:- Creating matrix variables, Assignment Help, Ask Question on Creating matrix variables, Get Answer, Expert's Help, Creating matrix variables Discussions

Write discussion on Creating matrix variables
Your posts are moderated
Related Questions
draw midpoint circle by matlab

The circuit diagram of an active filter is shown below. (a) Determine an expression for the transfer function of the filter. (b) Hence find an expression for the frequency res

design a rc phase shift oscillator for a particular frequency of oscillation and generate a sinusoidal signal

Q. The steady-state circuit i(t) in a series RL circuit due to a periodic sawtooth voltage is given by where θ n = tan -1 (nω 0 L/R).With the parameters V A = 25 V, T 0



write matlab program for Cubic Spline Sweep Surface

Problem 1. Create a vector representing x coordinates of a measurement with 20 points between 0 and 10. Create another vector y representing fake measurements which are related to


The Programming Concept: In most of the programming languages, random function returns a real number; therefore the real number would then have to be rounded to produce a rand