solving an equation and adding results to a matrix
3 views (last 30 days)
Show older comments
syms m;
syms n;
k=linspace(-3.5,+0.5);
z=zeros(1,100);
c=length(k);
for s=1:1:100
z(s)=solve((k(s)+1.5).^2+(m-0.75).^2==4,m);
end
I want to solve this equation for every value of k, but i can not add the result of solve function into elements of z matrix.
Unable to perform assignment because the left and right sides have a different number of elements.
Error in dneme (line 7)
z(s)=solve((k(s)+1.5).^2+(m-0.75).^2==4,m);
It gives the error above.
0 Comments
Accepted Answer
VBBV
on 25 Nov 2021
syms m;
syms n;
k=linspace(-3.5,+0.5);
z=zeros(1,100);
c=length(k);
for s=1:1:100
z =solve((k(s)+1.5).^2+(m-0.75).^2==4,m);
zz(:,s) = z;
end
zz
2 Comments
More Answers (0)
See Also
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!