How can I make a variable matrix?
显示 更早的评论
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)
采纳的回答
更多回答(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
类别
在 帮助中心 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!