Solve parametric equations involving two vectors

1 回表示 (過去 30 日間)
Marol Valencia
Marol Valencia 2021 年 11 月 22 日
回答済み: Shanmukha Voggu 2021 年 12 月 2 日
Hi, I am trying to create a function that finds a vector 'P ' from two parametric lines generated by vectors, these lines are 'O' and 'Bet'. 'P' is the point where these two lines meet. There seems to be a problem with the way I am defining the parameter 't', which describes this lines. How can I solve this?
function [P] = VCI (mag1, X, inicial1, mag2, Y, inicial2)
A = [mag1.*cosd(X) mag1.*sind(X)]'+inicial1;
B = [mag2.*cosd(Y) mag2.*sind(Y)]'+inicial2;
if X==Y || (X==Y+180 || Y==X+180)
syms t real
O= [-mag1.*sind(X).*t mag1.*cosd(X).*t]'+inicial1;
Bet=(A-B).*t+A;
S=solve(O==Bet,t);
P=(A-B).*S+A
end
%The following is an example of what I get when I run the code
>> VCI(10, 50, [0;0], 5, 50, [0;1])
Error using symengine
Array sizes must match.
Error in sym/privBinaryOp (line 1039)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in .* (line 323)
X = privBinaryOp(A, B, 'symobj::zipWithImplicitExpansion', '_mult');
Error in VCI (line 9)
P=(A-B).*S+A
  1 件のコメント
Matt J
Matt J 2021 年 11 月 22 日
You need to demonstrate the problem for us. We don't know how you ran this function or what you see as a result.

サインインしてコメントする。

回答 (1 件)

Shanmukha Voggu
Shanmukha Voggu 2021 年 12 月 2 日
Hi Marol,
symengine is not recommended. Use equivalent Symbolic Math Toolbox™ functions that replace MuPAD®functions instead. For more information, see Compatibility Considerations.
Refer this for more information

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by