Creating a mat file with binary mask
显示 更早的评论
I want to create a 256*256 mask.mat file, where the middle 32 lines will be white (binary 1) and in there will be 30 lines of 1, randomly other than these 32 lines. I tried the below code: what should I add:
row = 256;
col = 256;
mask = zeros(row, col);
mask(:, 113:144) = 1;
figure, imshow(mask);
save("new-created-mask.mat", "mask");
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Display Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!