Solve a numerical equation using for loop
이전 댓글 표시
I'm trying to solve a numerical equation with with two variables x,y with for loop that are basically normalized of each other but I get the error below. I would really appreciate if someone could please help me. Here is the code and error message:
A=rand(10,10);
B=rand(10,10);
C=rand(10,10);
xAve=2;
t=0.1;
x = zeros(10,10);
y = zeros(10,10);
S = zeros(10,10);
syms x y
for i=1:10
for j=1:10
eqn=(x(i,j)*y(i,j))== (A(i,j)*B(i,j)*t^2)/(xAve*C(i,j));
S(i,j)=vpasolve(eqn,[x,y]);
end
end
Error:
Conversion to double from struct is not possible.
Thanks in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

