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 =


>> [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
How to simulate a robot

The diagram shown on the next page represents a planar pantograph-based leg for a walking robot. This model utilizes only one DOF to generate the walking gait at the foot link 'n

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

How do you write a programme that asks the user for a number between 1 and 1000 and calculates the sum of its digits?

Savannah says that the least common multiple of 4 and 6 is 24. Is she right or what is her mistake?

I would like to ask if its possible to get help programing in matlab. If yes - how can I get help ?

Explain how the wavelet transform based on the real biorthogonal "decomposition" wavelet bior 1.5 (the wavelet shape by typing waveinfo ('bior') at the MATLAB command prompt) can