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
http://messenger.providesupport.com/messenger/ae.html?ps_s=U4nFMQo4BP04

write a function program to compute a standard deviation of a number

How to Start Working withSimpower: 1. In the Simulink screen, open a new "Model" (File àNewà Model), name it and save it. 2. Expand the SimPowerSystems library, select and

I have an assignment to do by MATLAB : the assignment is to design Script that makes (Panorama Stitching) for multiple pictures .. for more information see the link : tobw.net/inde

what is matlab

Strings: The MATLAB also handles strings that are a sequence of characters in single quotes. For illustration, using the double function on a string will represent the equival

how do I make a second main function?

Write a program in Mathlab for addition of two matrices.

User-Defined Functions which return a Single Value: We have seen the use of many functions in the MATLAB. We have used many built-in functions like fix, sin, abs, double, and

1) Identify an equation that describes some chemical process.  Your equation should have at least two parameters, at least one of which should contribute in a non-linear way. He