Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Function "Size"

Subject: Function "Size"

From: Ng

Date: 1 Dec, 2010 15:15:25

Message: 1 of 2

m = size(X,dim) returns the size of the dimension of X specified by scalar dim.

What is function size ?

I don't understand also even have the definition.

Can somebody help me and show me some example ?

Thank you.

Subject: Function "Size"

From: Sean de

Date: 1 Dec, 2010 15:25:22

Message: 2 of 2

"Ng " <yeongchuan88@gmail.com> wrote in message <id5oqd$er8$1@fred.mathworks.com>...
> m = size(X,dim) returns the size of the dimension of X specified by scalar dim.
>
> What is function size ?
>
> I don't understand also even have the definition.
>
> Can somebody help me and show me some example ?
>
> Thank you.

size is a built-in function that will tell you the number of elements in each dimension. Using the second input argument 'dim', you can have it tell you the number of elements in that specific dimension

%%% Run what's below in your MATLAB command window
A = rand(3,4);
size(A)

size(A,2)
%%%
doc matlab % Then click on getting started

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us