MATLAB Answers

making picture through imshow

1 view (last 30 days)
relamanma
relamanma on 20 Sep 2020
Commented: relamanma on 20 Sep 2020
I want to make size 256x256 picture
A = ones(16);
num = 1;
for i = 1:floor(length(A)/2)
num = 1-num;
A(1+i:end-i, 1+i:end-i) = num;
end
it doesn't work how I want to make
it there any different way?
  3 Comments
relamanma
relamanma on 20 Sep 2020
If you have time to hel...p !!

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 20 Sep 2020
Z = logical(256,256);
Z([1:16,end-15:end], :) = true;
Z(:, [1:16,end-15:end]) = true;
You should be able to continue from there.

Tags

Community Treasure Hunt

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

Start Hunting!