How can I make a variable matrix?
Show older comments
I want to make variable matrices for my matrix equation: (2*A_11*r_i^2*C(1,2)*[U_1; ...; U_N])+(2*A_11*r_i*C(1,1)*[U_1; ...; U_N])-(2*A_11*[U_1; ...; U_N])+(A_11*r_i^2*W0*C(1,2)*[W_1; ...; W_N])+(((A_11*r_i)-(Nu*A_11*r_i))*W0*C(1,1)*[W_1; ...; W_N])=0 which are [U_1; ...; U_N] and [W_1; ...; W_N]. If anyone could help I would be thankful. A_11 is a scalar and r_i is a vector [0 0.0334 0.125 0.250 0.375 0.4665 0.500] and C(1,2) and C(1,1) are 7*7 matrices and W0 's are scalar. Actually this is a equation system which has 2 more equations and I need to solve it and use the results for W0 's and make a loop with some error function and also some boundary conditions. But for now i just wanna figure the part of variable matrix out first. Code I used is here and it is not right:
syms U
for N = 1:7
U(7,1) = U(N);
end
disp(U)
Accepted Answer
More Answers (1)
syms U [7 1]
for N = 1:7
U(7,1) = U(N);
end
disp(U)
I suspect this is not what you want. I suspect what you want is just
syms U [7 1]
U
Categories
Find more on Number Theory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!