plot to find root Error: Unbalanced or unexpected parenthesis or bracket
2 次查看(过去 30 天)
显示 更早的评论
>> v0 = 20; x = 35; y0 = 2; y = 1; g = 9.81;
theta0 = linspace(0,90);
ftheta0 = tan(theta0)*x-(g/(2*v0^2*cos^2(theta0))*x^2)+y0-y;
??? ftheta0=tan(theta0)*x-(g/(2*v0^2*cos^2(theta0))*x^2)+y0-y;
|
Error: Unbalanced or unexpected parenthesis or
bracket.
0 个评论
采纳的回答
Walter Roberson
2016-3-4
编辑:Walter Roberson
2016-3-4
MATLAB does not support the syntax cos^2(theta0) to mean the square of the cos of theta0. You need to use cos(theta0).^2
0 个评论
更多回答(1 个)
Joachim Schlosser
2016-3-4
MATLAB will point you exactly to where it cannot cope with the input. There is a "*" missing in 2(theta0).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!