Unrecognized function or variable 'x'.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello.
I don’t understand why I don’t have x defined after running the code, if initially it says errors. Help me please
function F=M36(x)
F=[3*x(1)*x(2) - x(1)^2 - x(2)^2 - 5;
7*x(1)^2 * x(2)^2 - x(1)^4 - x(2)^4 - 155];
options = optimoptions('fsolve','Display','iter');
[~,~] = fsolve(F,[-4,0],options);
[~,~] = fsolve(F,[0,4],options);
disp('Plotting graphs of the left sides of the system equations:')
x=-5:0.1:5;
y= (3/2).*x+ sqrt((13/4).*x.^2+5);
plot(y,x,'b')
hold on
x=-5:0.1:5;
y = sqrt((x^4 + 155) / (7*x^2 - y^2));
plot(y,x,'b')
hold on
grid on
legend('Graphic solution');
end
댓글 수: 3
Walter Roberson
2023년 11월 16일
syms x [1 2]
eqns = [3*x(1)*x(2) - x(1)^2 - x(2)^2 == 5;
7*x(1)^2 * x(2)^2 - x(1)^4 - x(2)^4 == 155]
sol = solve(eqns)
subs([x1, x2], sol)
답변 (1개)
Walter Roberson
2023년 11월 16일
F = @(x)[3*x(1)*x(2) - x(1)^2 - x(2)^2 - 5;
7*x(1)^2 * x(2)^2 - x(1)^4 - x(2)^4 - 155];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!