What is wrong with my code?

조회 수: 1 (최근 30일)
Ibrahim Butt
Ibrahim Butt 2020년 10월 25일
댓글: Ameer Hamza 2020년 11월 4일
% Itfinds the velocity using RK 4 method
clc; % Clears the screen
clear all;
F = @(t,v) 9.81 - ((0.28/85) * (v^2));
t0 = input('Insert the value of the initial time: ');
v0 = input('Insert the value of the initial velocity: ');
tfinal = 20;
h = input('Insert the value of the step size: ');
v = RK_4(F,t0,h,tfinal,v0);

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 10월 25일
You need to write the RK_4 function. Right now, RK_4 is the name of your current script. You can find one implementation of the Runge Kutta-4 algorithm here: https://www.mathworks.com/matlabcentral/fileexchange/29851-runge-kutta-4th-order-ode
  댓글 수: 4
Ibrahim Butt
Ibrahim Butt 2020년 11월 3일
Thank you very much for helping me in correcting my mistakes and clearing my doubts.
Ameer Hamza
Ameer Hamza 2020년 11월 4일
I am glad to be of help!!!

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

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by