필터 지우기
필터 지우기

How can I introduce a scatter plot for this?

조회 수: 1 (최근 30일)
Ana Carla Díaz Aguirre
Ana Carla Díaz Aguirre 2020년 11월 15일
답변: Monica Peña 2022년 11월 30일
%Valores iniciales/inicial values
C= 100;
D= 0.1;
b= 0.15;
m= 0.05;
g= 9.81;
h= 0.001;
yn= 0;
vo=0;
yo=0;
yf=0;
%Procedimiento con metodo de Euler/Eulers meythod
for dt=0:h:(5-h)
vf=C*(h/m)*(D-yf)-(g*h)+(vo*(1-(b*h)/m));
vo=vf
yf=yo+vf*h;
yo=yf
end
%I would want to make a scatter for dt and vo, and another for dt and yo
  댓글 수: 1
Ana Carla Díaz Aguirre
Ana Carla Díaz Aguirre 2020년 11월 15일
I´m new in this, so i really dont know how to do it, i did it with a readtable in excel and its like this:
but i need to do it with scatter.

댓글을 달려면 로그인하십시오.

답변 (2개)

Setsuna Yuuki.
Setsuna Yuuki. 2020년 11월 15일
편집: Setsuna Yuuki. 2020년 11월 15일
Espero que esto te sirva :D
C= 100;
D= 0.1;
b= 0.15;
m= 0.05;
g= 9.81;
h= 0.001;
yn= 0;
vo=0;
yo=0;
yf=0;
i = 1;
%Procedimiento con metodo de Euler/Eulers meythod
for dt=0:h:(5-h)
vf=C*(h/m)*(D-yf)-(g*h)+(vo*(1-(b*h)/m));
vo=vf;
v0(i) = vo; %Almacena en una variable que no se volverá a utilizar despues
yf=yo+vf*h;
yo=yf;
y0(i) = yo; %Almacena en una variable que no se volverá a utilizar despues
i = i+1;
end
dt = 0:h:(5-h)
scatter(dt,v0,'b'); %scatter dt vs vo
figure
scatter(dt,y0,'r'); %scatter dt vs yo
  댓글 수: 2
Ana Carla Díaz Aguirre
Ana Carla Díaz Aguirre 2020년 11월 15일
omggg mil gracias!!
Setsuna Yuuki.
Setsuna Yuuki. 2020년 11월 15일
De nada 😊

댓글을 달려면 로그인하십시오.


Monica Peña
Monica Peña 2022년 11월 30일
Hola, Una pregunta como podria hacer una funcion con el metodo Euler que encuentre la solucion aproximada, y aplique interpolacion

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by