Clear Filters
Clear Filters

how can alter this code to select some matrix ?

3 views (last 30 days)
if i have this code
for iii=1:4
X = randi([0 1],3,3);
end
how can i select the X number 2 and number 4 like this
X = [ 1 1 0
0 1 0
0 0 1 ]
X = [ 0 1 0
1 1 1
1 0 0]
X = [1 1 1
0 1 0
1 1 0]
X = [1 0 1
1 1 0
1 0 0 ]
i want the result be
X = [ 0 1 0
1 1 1
1 0 0]
X = [1 0 1
1 1 0
1 0 0 ]

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 2 May 2016
X={[ 1 1 0;0 1 0;0 0 1 ], [ 0 1 0;1 1 1;1 0 0]...
[1 1 1;0 1 0;1 1 0],[1 0 1;1 1 0;1 0 0]}
X{2}
X{4}

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!