Borrar filtros
Borrar filtros

Info

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

how can i use for loop for the given situation

1 visualización (últimos 30 días)
sneha kriplani
sneha kriplani el 26 de Jun. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
X=randi([1,5],3,1);
Y=randi([1,5],3,1);
for i=1:3;
Xnew(i)=[X(i,1)+.6];Xn=Xnew';
Ynew(i)=[Y(i,1)+.4];Yn=Ynew';
end
plot(Xn,Yn,'kd');
grid on;hold on;
D2X=randi([1,5],3,1);
D2Y=randi([1,5],3,1);
plot(D2X,D2Y,'ro');hold off;
axis([1,50,1,50]);
my problem is like on the first day source is generating three particles then these three particles move with the groundwater velocity, on the second day three particles again are generated by the source, on the third day again three particles by source and former particles will be moving with the groundwater velocity, source generates particles in a definite range only lets say (0-5). this will continue till 365 days.
  1 comentario
Adam
Adam el 26 de Jun. de 2015
Please format your code to be more readable.
Also your description seems to bear no relation to your code. You talk about concepts of days, sources, particles, velocities, etc yet your code just has X, Y, D2X, etc variables. You can't assume we instantly know everything about your problem domain.
Try to keep the question terminology and the code terminology matched up (i.e. use meaningful variable names). It is far better for yourself and anyone else who needs to understand your code as well as for people expected to answer your question!

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by