function never used, I dont know why.
이전 댓글 표시
I am using code from http://www.chuacircuits.com/matlabsim.php
%----------Chua.m----------
function out = chua(t,in)
x = in(1);
y = in(2);
z = in(3);
alpha = 15.6;
beta = 28;
m0 = -1.143;
m1 = -0.714;
h = m1*x+0.5*(m0-m1)*(abs(x+1)-abs(x-1));
xdot = alpha*(y-x-h);
ydot = x - y+ z;
zdot = -beta*y;
out = [xdot ydot zdot]';
%----------StartChua.m----------
[t,y] = ode45(@chua,[0 100],[0.7 0 0]);
plot3(y(:,1),y(:,2),y(:,3))
grid
end
It confuses me, cause obviously this code was already tested. matlab tells me now i have to put an "end" for the function, even tho the original code doesnt have one, ok I did it.
Then it tells me the function is never used, and [t,y] = ode45(@chua,[0 100],[0.7 0 0]); tells me that the function chua doesnt exist ?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
