HI HOW TO GENERATE A DOT MATRIX WITH ONES AND ZEROS?

4 Ansichten (letzte 30 Tage)
SRI
SRI am 18 Mär. 2014
Kommentiert: Andrei Bobrov am 18 Mär. 2014
HI I HAD GENERATE A MATRIX OF ONES(8)
MY QUESTION IS I WANT TO MAKE ALL THE EVEN ROWS OF THAT MATRIX TO ZERO...
HOW CAN I DO THAT PROCESS
CAN ANYONE HELP ME.

Antworten (1)

Roger
Roger am 18 Mär. 2014
Bearbeitet: Roger am 18 Mär. 2014
A=ones(8);
for i=1:4
A(2*i,:)=zeros(1,8);
end
or A(2:2:8,:)=zeros(1,8);

Kategorien

Mehr zu Resizing and Reshaping 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