problem with solve commans

2 次查看(过去 30 天)
avner yakov
avner yakov 2017-6-16
评论: Adam 2017-6-16
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
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!

Translated by