error in subplot
Mostrar comentarios más antiguos
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 comentarios
Image Analyst
el 8 de Oct. de 2011
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
el 8 de Oct. de 2011
Oh, sorry, they're in the same mth position but on different figure windows. But what is your question?
FIR
el 8 de Oct. de 2011
Jan
el 8 de Oct. de 2011
If you get an error, post the error message.
FIR
el 8 de Oct. de 2011
Jan
el 8 de Oct. de 2011
@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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!