Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Combine two matlab plotting commands to execute loops of figures

1 visualización (últimos 30 días)
George
George el 18 de Jul. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I am a new user in matlab, i have two separate commands and would like to combine them so as to produce figures in a loop with a specific pause
these are the two separate approaches
1. Create the base figure from A , A2, A3 , ... An
who A*
filenames = who('A*')
for i=1:3
pause(2);contourf(eval(filenames{i})),colorbar
end
2. Second portion is to superimpose a quiver with B, B1, B2 ....N and C,C2,C3,...n
[nx,ny]= size(A)
xx=1:1:ny;
yy=1:1:nx;
pause(2);contourf(eval(xx,yy,A)),colorbar
hold on
delta = 8;
quiver(xx(1:delta:end),yy(1:delta:end),B(1:delta:end,1:delta:end), ...
C(1:delta:end,1:delta:end),1)
hold off
3. I tired to combine them but i think i am missing something, probably the eval ?
filenames = who('A*')
B10 = who('B')
C10 = who('C')
for i=1:3
[nx,ny]= size(A)
xx=1:1:ny;
yy=1:1:nx;
pause(2);contourf(eval(xx,yy,filenames{i})),colorbar
hold on
delta = 8;
quiver(xx(1:delta:end),yy(1:delta:end),B10{i}(1:delta:end,1:delta:end), ...
C10{i}(1:delta:end,1:delta:end),1)
hold off
end
Any help is welcome
  1 comentario
Michelle Hirsch
Michelle Hirsch el 24 de Jul. de 2014
George -
Could you explain more of what you are trying to achieve by using eval? I almost always find that there's a better option than using eval, leading to code that's more robust and typically a fair bit easier to read.
-Michelle

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by