how to correct ''Function definitions are not permitted in this context.''
Afficher commentaires plus anciens
Function definitions are not permitted in this context.
a = 0.5;
B = 0.6;
k = 1;
[t, x] = ode45(@Ray, [0 30],[ 0 0.1], [], a, B, k);
plot(x(:,1), x(:,2), 'k-')
function d = Ray(t, y, a, B, k)
d=[y(2);-k*y(1)+a*y(2)-B*y(2^3];
Réponse acceptée
Plus de réponses (1)
sarvesh aundhkar
le 22 Nov 2017
0 votes
function test() a = 0.5; B = 0.6; k = 1; [t, x] = ode45(@Ray, [0 30],[ 0 0.1], [], a, B, k); plot(x(:,1), x(:,2), 'k-') function d = Ray(t, y, a, B, k) d=[y(2);-k*y(1)+a*y(2)-B*y(2^3];
Catégories
En savoir plus sur App Building 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!