How can I change a 3x3 matrix into several matrices which are multiple and plusing together?

I want to change a 3x3 matrix to a several matrices for example my 3x3 matrix is A and I have 3 symbolic which I want to factor from and make the other matrices I mean
A=[a*cos(h)+d,b*sin(g)+e,c*sin(i)+f;a*sin(g)+f,b*cos(i)+e,c*sin(h)+d;a*cos(g)+d,b*sin(h)+f,c*sin(i)+e]
B[a;b;c]
%
C=[cos(h),sin(g),sin(i);sin(g),cos(i),sin(h);cos(g),sin(h),sin(i)]
D=[d,e,f;f,e,d;d,f,e]
I want to write a code that I give (A and B) and get (C and D)

7 Comments

You are trying to solve A=C*B+D. Have you tried the solve function?
syms a b c d e f g h i
A=[a*cos(h)+d,b*sin(g)+e,c*sin(i)+f;a*sin(g)+f,b*cos(i)+e,c*sin(h)+d;a*cos(g)+d,b*sin(h)+f,c*sin(i)+e];
B=[a;b;c];
C=[cos(h),sin(g),sin(i);sin(g),cos(i),sin(h);cos(g),sin(h),sin(i)];
D=[d,e,f;f,e,d;d,f,e];
sol=solve(A==C*B+D,[d e f g h i]);
This returns only empty syms, meaning that Matlab can't find a general solution to your question.
actually I don't want to definition C and D matrices I have only A and B and I want the code give C and D, it's better to say I want to factor B from A and give C and D
You should provide a MWE to explain what you want to do. What is your data and what is your desired output?
let me give an example if we have this equation a=3.*x+5 and b=4.*y+3 then we could definition [a;b]=[x;y].*[3;4]+[5;3] now I want to write a code which by getting A and X gives C and D (in this example A=[a;b] and X=[x;y] and C=[3;4] and D=5;3])
If you want A = C*X + D, then shouldn't C equals [3 0; 0 4]?
yes you're right C must equal to this
let me ask my question clearly how can I get a factor from a 3x3 matrix which the vars is a 3x1 matrix?

Sign in to comment.

Answers (0)

Tags

Asked:

on 28 Feb 2018

Commented:

on 28 Feb 2018

Community Treasure Hunt

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

Start Hunting!