Solve a numerical equation using for loop
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox 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!
