problem with solve commans
2 ビュー (過去 30 日間)
古いコメントを表示
i'm trying to model basketball shot, matlab showing me an error in the solve function.
clear all
clc
theta=[pi/18:0.01:pi/2.01]; %%angles range
l=7; %%horizental distance
h=1; %%vertical distance
Rb=0.1; %%ball radius
Rr=0.25; %%ring radius
g=9.8; %%gravity
V=(l./cos(theta)).*sqrt(4.9./(l*tan(theta)-h)); %%speed as function of angle
syms theta_o %%the edge angle who stiil enter the ring in the same velocity
for i=1:numel(V)
T(i)=(V(i)*sin(theta_o)+sqrt(V(i)^2*sin(theta_o)^2+2*9.8*h))/9.8;
x(i)=V(i)*cos(theta_o)*T(i);
y(i)=V(i)*sin(theta_o)*T(i)-4.9*T(i)^2;
square_s(i)=(x(i)-(l-Rr))^2+(y(i)-h)^2;
end
for i=1:numel(V)
A(i)=solve(square_s(i)==Rb^2,theta_o);
B(i)=solve(x(i)-l+Rb-Rr==0);
end
someone can help?
this is the error message Error using subsasgn Subscripted assignment dimension mismatch.
Error in sym/privsubsasgn (line 997)
L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
Error in sym/subsasgn (line 834)
C = privsubsasgn(L,R,inds{:});
1 件のコメント
Adam
2017 年 6 月 16 日
That can't be the full error message surely? It doesn't include the function or line or code that is actually making the call.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!