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
Calculating and Visualizing Sequence Statistics Follow the instructions in this demo file to download a sequence and calculate and visualize its statistics. Save all the command

kind in geometric calculity in space AREA. >

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

Random numbers: Whenever a program is being written to work with a data, and the data is not yet available, it is frequently useful to test the program first by initializing t

Relational Expressions: The Conditions in if statements use expressions which are theoretically, or logically, either true or false. These expressions are termed as relational

RECOGNIZER and TRANSLATOR: i want to recognized devanagari word using matlab. I have done it using template matching. but i am not get devanagari word at the output. But get speci

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

Digging the Dirt: Autonomous Mining Robots   Mining is a multi-billion dollar industry and a critical part of the Australian economy. Much of the day-to-day work on mining sites

use the loop for to produce [-1 -1 -1 -1; 0 -1 -1 -1; 0 0 -1 -1; 0 0 0 -1]

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