how to call odefunction from classdef
Ältere Kommentare anzeigen
I want to call odefunction from classdef, but I don't know the way.
classdef plactice
properties
L = 1;
m = 1;
g = 9.8;
Tspan = linspace(0,2,20);
theta_ic = [0;0];
b = 0.01
u = randi([10 25],1,1);
end
methods
function [dtheta_dt] = ode_function(t, theta,g,L,u,b)
theta1 = theta(1);
theta2 = theta(2);
dtheta1_dt = theta2;
dtheta2_dt =-(g/L)*(theta1)-b*(theta2)-u;
dtheta_dt = [dtheta1_dt; dtheta2_dt];
end
end
end
The class may be written incorrectly.Is it written correctly?
please someone tell me.
Check the call to the function'ode_function' for incorrect argument data types or missing arguments.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!