Error in simple ode45 functions
4 views (last 30 days)
Show older comments
Amit Kumar on 24 Sep 2014
Commented: Star Strider on 24 Sep 2014
Hello, I am trying to solve a non-stiff 2nd order ODE with ode45 function. My ODE is d^2y/dt^2 = -g + (4/15)*(1/m)*(dy/dt)^2
Here is the ode function file that I made
function [ ode_fun_vect ] = ode_1_fun( t,z )
global m g
And here is script to solve ode:
However I am getting some errors saying: Output argument "ode_fun_vect" (and maybe others) not assigned during call
Can someone help me? Thanks in advance!
You defined ‘ode_fun_vect’ as your function output and ‘ode_fun_vec’ as the value it calculates. Change one or the other and your ODE integrates successfully.
That’s the first problem I look for, since I have typos in my own code more often than I’d like to admit.
More Answers (0)
Find more on Programming 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!