How do i get rid of error in line 1 after running script
1 次查看(过去 30 天)
显示 更早的评论
%this is the code
syms x;
y1=2*x^3-x+8;
y2=15*x^2-17*x-4;
disp('At the Intersection both the curve point will be same');
disp('Therefore equating both the curves : 2*x^3-x+8 = 15*x^2-17*x-4 ');
disp('Equation becomes : 2*x^3-15*x^2+16*x+12 = 0');
p=[2 -15 16 12];
r=roots(p);
x=r;
y=[0 0 0];
y22=[0 0 0];
for i=1:3
x1=x(i);
y(i) = 2*x(i)^3-x(i)+8;
i=i+1;
end
disp('The intersection points are : ');
for j=1:3
fprintf('(%.2f,%.2f) ',x(j),y(j));
end
%its supposed to output
4 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!