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!