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 view (last 30 days)
Show older comments
GABRIEL GARCÍA CASA
on 16 Oct 2019
Edited: KALYAN ACHARJYA
on 17 Oct 2019
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
0 Comments
Accepted Answer
KALYAN ACHARJYA
on 17 Oct 2019
Edited: KALYAN ACHARJYA
on 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
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!