If I have to create a number with a boolean matrix, is it possible to flip a column but still conserve it on its original position? How?

1 vue (au cours des 30 derniers jours)
function A = pinta_display(num)
A = ones(150,100);
if num == 1
A (20:130,70:80) = 0;
imshow(A)
% Here 1 is drawn on the left, could I flip it to the left and still conserve it on the right? How?
end
end

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 17 Oct 2019
Modifié(e) : KALYAN ACHARJYA le 17 Oct 2019
"is it possible to flip a column but still conserve it on its original position? How?
No
Any matrix elements positions are specify by row and column number. Say matrix A. A(i,j), here i represents the row number and j represents the coumn number. If you flip the column number, then j value is change. But if the matricices elements with all 1 or 0, then if yoy flip the any rows or column, the resultant matrices represennts the same.
Or Is this you are looking for?
function A = pinta_display(num)
A=ones(150,100);
if num==1
A (20:130,70:80)=0;
A (20:130,20:30)=0;
imshow(A)
% Here 1 is drawn on the left, could I flip it to the left and still conserve it on the right? How?
end
end
567.png

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by