hi!
i want to print this matrix..
i think there is a easy pattern in this matrix but i couldn't found..!
Is there a easy way to create this matrix?

 Akzeptierte Antwort

KSSV
KSSV am 1 Apr. 2022

0 Stimmen

A = zeros(6,5) ;
A(1:3,1:3) = 1 ;
A(:,4) = [1 0 0 1 1 1]' ;
A(:,5) = [1 0 0 1 1 1]' ;
A
A = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1

Weitere Antworten (1)

Stephen23
Stephen23 am 1 Apr. 2022

0 Stimmen

M = repelem([1,1;1,0;0,1],[1,2,3],[3,2])
M = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1

Kategorien

Mehr zu MATLAB Compiler finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 1 Apr. 2022

Beantwortet:

am 1 Apr. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by