如何在 MATLAB 上绘制带有变量的向量

How do I graph a vector with a variable on MATLAB

我怎样才能画出像这样的东西 (3x^2+5,4x) ,我通常使用 GeoGebra 来画出它,但我不能把它应该看起来像这样的域 (GeoGebra)

应该这样做:

y = -10:0.1:10;
x = 3 * y.^2 + 5.4 * x;

plot(x, y)
grid on

从图表中,您似乎在水平轴上取 3x²+5,在垂直轴上取 4x,因此:

x = -5.5: 0.01: 5.5;
plot(3*x.^2+5, 4*x, 'r');

%other minor adjustments to match with the graph in your post
grid on;    grid minor;    %to display grid lines
set(gca, 'XAxisLocation', 'origin');  %setting x-axis location to 'origin'
legend('eq2'); %to display the legend

给出: