Borrar filtros
Borrar filtros

plotting in for loop

1 visualización (últimos 30 días)
abdalrhman hassan
abdalrhman hassan el 21 de Abr. de 2016
Comentada: abdalrhman hassan el 21 de Abr. de 2016
hello, i'm tring to plot h with Q but the graph shows empty and when add hold on it apears points not continuous curve
clc;clear; a=1;t1=100;t2=20;l=.01;k=1; for h=1:1:100 syms ts q=-(a*h*(ts-t2))+(k*a*(t1-ts)/l); Ts=solve(q); Q=a*h*(Ts-t2); plot(h,Q) axis([1,100,50,4000]) grid on end

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 21 de Abr. de 2016
Editada: Azzi Abdelmalek el 21 de Abr. de 2016
clc;clear;
a=1;t1=100;t2=20;l=.01;k=1;
syms ts
hh=1:100;
for h=hh
q=-(a*h*(ts-t2))+(k*a*(t1-ts)/l);
Ts=solve(q);
Q(h)=a*h*(Ts-t2);
end
plot(hh,double(Q))
axis([1,100,50,4000])
grid on
  1 comentario
abdalrhman hassan
abdalrhman hassan el 21 de Abr. de 2016
Thank you That's was helpful but can you explain what you did please

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by