how to call odefunction from classdef
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!