error in subplot
이전 댓글 표시
sir i have 15 images in a folder names,mri,i load this folder to perform 4 operations,low pass,high pass etc,
so there are 15 images in low and high pass amd so on,wen i subplot for each,15th low pass figure is repacles by first image oh gigh pass and so on,can u tell how to process please
pathname ='C:\mri\' ;
dirlist = dir( [pathname '*.tif'] );
pickind='tif';
for m = 1:length(dirlist)
i = imread([pathname, dirlist(m).name]);
A=i;
figure(1),subplot(4,4,m),imshow(A);
figure(2),subplot(4,4,m),imshow(B),title('low pass filter coefficients');
figure(3),subplot(4,4,m),imshow(C),title('high pass filter coefficients');
댓글 수: 6
Image Analyst
2011년 10월 8일
I don't know what you're asking. Your code is badly formatted and I don't see an "end" for your "for" loop, nor do I see how you got B and C. But whatever, for each iteration you're showing A, B, and C all in the same m-th plot, thus overwriting each other. Again, I'm not sure what you tried to ask but that doesn't seem like something you'd want.
Image Analyst
2011년 10월 8일
Oh, sorry, they're in the same mth position but on different figure windows. But what is your question?
FIR
2011년 10월 8일
Jan
2011년 10월 8일
If you get an error, post the error message.
FIR
2011년 10월 8일
Jan
2011년 10월 8일
@FIR: There is no reason for shouting. I just want to help, but I need an exact description of the error. Usually "error" means, that Matlab stops the execution with a descriptive message in the command window. In this case, it is helpful to post a copy of this message.
If you have another problem, it would be helpful if you describe it with more details. "The error is in the last image" and "that image must come in next figure" does not contain the necessary details. Do you simply want to run the loop until 14 and open a new figure afterwards? Then:
if m==14, figure(4) ...
BTW, what is "B" and "C"?
Your code would be easier to read, if you apply the standard code formatting used in this forum. Follow the "Markup help" link to learn more.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!