Print H M & W in matlab imshow in best and simplest method. Funny Trick
To print H
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1syLsO3QlFpAF5yzR2g3stp6h-EUDlrJE_U03yX9hHtYbbdZKRn0ZHcjQFJrra6hguWUkCRdFYRHyATLru3Kx0lesR9zFYM2pjUUvfDpHCSTYcui1owK0BOsPlfTMmZ-JzGgpVKtUkUE/s1600/aa.png)
To print H
>>
h=zeros(60,60);
>>
h(11:50,21)=1;
>>
h(11:50,40)=1;
>>
h(30,21:40)=1;
>>
imshow(h)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1syLsO3QlFpAF5yzR2g3stp6h-EUDlrJE_U03yX9hHtYbbdZKRn0ZHcjQFJrra6hguWUkCRdFYRHyATLru3Kx0lesR9zFYM2pjUUvfDpHCSTYcui1owK0BOsPlfTMmZ-JzGgpVKtUkUE/s1600/aa.png)
To print M and W just put the following commands
m=zeros(60,60);
for a=21:30
for b=21:30
if a==b m(a,b)=1;
end
end
end
m=fliplr(m)+m;
m(21:50,21)=1;
m(21:50,40)=1;
%To print W just rotate the image180. Otherwise just show apply imshow(m) commad.
m=imrotate(m,180);
imshow(m)
No comments:
Post a Comment