solving an equation and adding results to a matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
VBBV
2021년 11월 25일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!