why is my plot not showing anything
Show older comments
function BTLnhom11
clear;
close;
syms t v;
disp('Chon chieu duong huong len')
disp('Chon goc toa do tai mat dat');
disp('Phuong trinh dinh luat II Newton cho ten lua');
fprintf('\t\tm*dv/dt = -v0*dm/dt - mg\n');
k=input('Nhap toc do dot nhien lieu dm/dt = ');
m0=input('Nhap khoi luong ban dau cua ten lua m0 = ');
y0=input('Nhap vi tri ban dau cua ten lua y0 = ');
v0=input('Nhap van toc day khi cua ten lua v0 = ');
g=9.81;
v=v0*log(m0/(m0-k*t))-g*t;
t1=m0/k;
disp('Gia toc cua ten lua a=');
a=diff(v,1);
disp(a);
disp('Phuong trinh chuyen dong ten lua y = ');
y= y0+int(v,t);
disp(y);
fprintf('Ten lua het nhien lieu tai thoi diem t= %0.2f s\n',t1);
fprintf('Tai t= %0.2f s ten lua khong con chuyen dong\n',t1);
fplot(y,[0 t1],'r');
title('Do thi bieu dien phuong trinh chuyen dong cua ten lua');
xlabel('Thoi gian t');
ylabel('Do cao(h)');
grid on;
I want to plot y, but it not working.
2 Comments
Walter Roberson
on 3 Dec 2021
We would need to know the input values in order to test this.
Quang Nguyen
on 3 Dec 2021
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


