how to play fsolve using for loop
Show older comments
i want to solve x1 and x2 about a=0:0.01:2*pi
this is my error code
======================================
clear all; clc
ct=1;l2=2.1; l1=2.5; r=0.7; z=5.5; d=1.2; h=1.8;
for a=0:0.01:2*pi
x(ct)=fsolve(@bicycle,[1,0]);
ct=ct+1;
end
==========================
function F = bicycle(x)
l2=2.1; l1=2.5; r=0.7; z=5.5; d=1.2; h=1.8;
F(1) = l1*sin(x(1))-l2*sin(x(2))-d-r*cos(a);
F(2) = z-l1*cos(x(1))-l2*cos(x(2))-h-r*sin(a);
end
how can i solve x1 and x2?
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!