Plotting 2 parameters function in MATLAB

133 Views Asked by At

I want to plot 2 functions in MATLAB.
First one is like this: X=[0.1 0.2 0.3]; Y=[5 4 1]; plot(X,Y); and the second one that I want to plot on the last function at the same figure is $$x^{2}y+3x+4y^{2}=1$$
I really confused about that!!

1

There are 1 best solutions below

0
On

If I understood correctly your problem it should be really easy. For the first plot you do:

figure
X=[0.1 0.2 0.3]; 
Y=[5 4 1]; 
plot(X,Y);
hold on % This holds the lines you have already plot

For the second plot I suggest you to explicit the function $x^{2}y+3x+4y^{2}=1$ with respect to $y$ (i.e. $y = f(x)$) then you do (after the previous commands):

plot(X,f(X))

That should solve your problem.

Of course you can put labels and titles to the plot by doing:

xlabel('the label for the x axis')
ylabel('the label for the y axis')
title('The title you want for the plot')

I hope this helped you.