how to get the first position in the array and get size array contains matrices

2 Ansichten (letzte 30 Tage)
Dear all,
I have a problem and I hope somebody can help.
I want to get the first index in the array, the array contains matrices and I want to get the first matrix, then I will do a loop start from the second matrix to the last matrix.
and I want to get size, I use "size" function but it returns " 4 2", how can I use the first number
note: assume array come form parameter of the function and it's hidden I don't know what array contain and the size of the array is unknown
example of the array :
m1=[ 0 1; 0 0];
m2=[ 0 1; 0 1];
m3=[ 1 1; 0 0];
m4=[ 1 1; 0 1];
array=[m1 m2 m3 m4];
index1=array(1);%not working
I hope I am clear enough.
Thanks in advance,
Ghaida

Antworten (1)

Stephen23
Stephen23 am 25 Jan. 2019
Bearbeitet: Stephen23 am 25 Jan. 2019

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by