How to solve matrix as a function
1 回表示 (過去 30 日間)
古いコメントを表示
I know this is simple for some, but I need a hand. I am learning this as I go with no assistance.
If I have three known variables, or 3x1 matrix Theta. I know m=cosd(Theta), and n=sind(Theta), and I want to solve another matrix T for each of the three Theta, how would you code this?
Ex: T = [m^2,n^2,2mn; n^2,m^2,-2mn; m,n,m^2n^2]
How can I enter this in and get three separate T matrices as my output? Thanks!
0 件のコメント
回答 (3 件)
Benjamin Schwabe
2012 年 2 月 15 日
What does m^2 mean? It's a vecor, isn't it? Componentwise operation? Or is it a real vecor-vectormultiplication resulting in a single number?
Andrei Bobrov
2012 年 2 月 15 日
m = reshape(cosd(Theta),1,1,[])
mq = m.^2;
nq = 1 - mq;
n = sqrt(nq);
mn = 2*m.*n;
T = [mq, nq, mn; nq,mq,-mn; m,n,mq.*nq]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Mathematics and Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!