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

In the manufacturing of ball bearings, the components, such as the ball, are hardened through a process of heating and then rapid cooling or "quenching" by submersion in an oil or

Need help with creating functions in matlab.


construct a matlab program to calculate and to plot the electron and hole concentration as a function of the Fermi-level in an energy gab of Si at a Given temperature and the carri

please tell me how to compress a video in matlab

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

Constants: The variables are used to store values which can change, or that are not known ahead of the time. Most of languages also have the capacity to store constants that a

Solve the optimality condition for each P equation against M according to the following relation: Condition for Optimality:         ∇ M = λ ∇ P      with respect to C and T.

The Format Function and ellipsis: The default in MATLAB is to show numbers which have decimal places with four decimal places. The format command can be used to identify the o