Plotting parallel line using the for-loop
显示 更早的评论
Good day to all the good members of this community. I like to solicit your help on this problem. I am new to matlab and I am trying to plot multiple parallel line across an image.
I have an image which is 300 X 300 in size and the Blocksize( BS) is 100 and I have divided this image into 9 blocks using the MAT2CELL function and all I am trying to do now is plot parallel lines over the image to visualize the areas of the image that fall under a particular block. Here is code I wrote
ImgBlks = mat2cell(IS, BlkSize, BlkSize); %this divided my image into 9 blocks.
imshow(IS);
BS = 100;
K = 1;
N = 300;
hold on
for j = 0:100:c
if j<1
j = 1;
end
T1 = [K,j];
T2 = [N,j];
plot(T1,T2)
end
hold off
this code is not giving me the desired result. I have tried to store the results in a vector by doing something like T1(j) = [K, j]; but it is giving me an error of dimentional mismatch. I would appreciate if anyone out there could help me overcome this problem. Thanks for your anticipated help.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!