Size function - dimensions of matrix, MATLAB Programming

Size function - Dimensions of matrix:

For the matrix mat shown next, it has three rows and two columns, therefore the size is 3 × 2. The length is the larger dimension that is 3.

>> mat = [1:3; 5:7]'

mat =

1     5

2     6

3     7

>> size(mat)

ans =

3    2

>> length(mat)

ans =

3

>> [r  c] = size(mat)

r = 3

c = 2

The size function returns two values; therefore in order to capture these values in separate variables we put a vector of two variables on the left of the assignment. The variable r stores the initial value returned, that is the number of rows, and c stores the number of columns.

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







Related Discussions:- Size function - dimensions of matrix, Assignment Help, Ask Question on Size function - dimensions of matrix, Get Answer, Expert's Help, Size function - dimensions of matrix Discussions

Write discussion on Size function - dimensions of matrix
Your posts are moderated
Related Questions
-The program should run always until the user enters -1 to exit from the program. - In the main, you should ask user to input any angles in degrees (Ad) and an integer number (N).

Solve for unknowns 'x' and 'y' from Equations (1) and (2) using MATLAB. (However, if MATLAB is not the appropriate software to solve these two simultaneous equations, please sugges

ACTIVITIES OF A PROJECT 1-2 1-3 1-4 1-5 2-6 3-6 3-7 4-7 5-7 7-6 6-8 7-8 THE COMMPANY LOSES 2,000 FOR EVERY WEEK THE PROJECT LASTS BEYOND 30 WEEKS. fOR EACH OF THE PROPOSALS; ACTIVI


Variables and Assignment Statements: A variable is used in order to store a value in a MATLAB session, or in a program. The Workspace Window represents variables which have be

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

Use an expression for the far-field radiation from a plane circular piston to create a more accurate model of a column loudspeaker system - you will need to calculate individual so

In this lab, we implement vectors, script and functions with plot. Plot function is used to plot the point into graph. These plots are handled by handle (h).  These handle is used

Introduction to Matlab: The MATLAB is a graphical and mathematical software package; it has graphical, numerical and programming capabilities. It has built-in functions to do

Illustration of Built-in functions and help: To find out what a specific function does and how to call it, type help and then the name of function. Illustration: >> help si