Symbolically solving vectors simultaneously
10 ビュー (過去 30 日間)
古いコメントを表示
Hello, I have been trying to solve a vector using the symbolic toolbox and am running into an error that says "Error using maplemex
Error, (in MTM:-solve) 0 variables do not match undefined outputs.", I am currently trying to solve for a variable in a matrix that is equal to zero, below is an example.
syms q0
moment=[5*q0+25 6*q0+45 5*q0+45]
[q0]=solve(moment==0)
This specific example is solving moment equilibrium for a monocoque structure.
Is there a way to solve the seperate q0 values so its a vector like [q0_1 q0_2 q0_3] using the symbolic toolbox?
Thanks!!!
0 件のコメント
採用された回答
Star Strider
2022 年 4 月 30 日
One solve statement (such as in the original post) also fails in R2022a. One option to get all of the solutions is arrayfun that should be available (another is an explicit loop) —
syms q0
moment = [5*q0+25 6*q0+45 5*q0+45];
q0 = arrayfun(@(x)solve(x), moment)
.
5 件のコメント
その他の回答 (1 件)
Paul
2022 年 4 月 30 日
q0 = sym('q0_',[1 3])
moment=[5*q0(1)+25 6*q0(2)+45 5*q0(3)+45]
solve(moment==0,q0)
2 件のコメント
Walter Roberson
2022 年 4 月 30 日
I do not recall whether the interface to maple supports using sym that way to create a vector. Maybe?
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!