Plots combining to produce one single plot
Ältere Kommentare anzeigen
I am completing a MATLAB course as part of my PhD studies but I am having an issue that is leaving me completely flumaxed. Early on in the module I used the following code to produce a plot, which all worked fine.
v = @(S,K,Vmax) Vmax*S/(K + S);
v1 = @(S) v(S,0.1,10);
v2 = @(S) v(S,1,10);
v3 = @(S) v(S,10,10);
limits = [0 10];
fplot(v1,limits,'r')
hold on
fplot(v2,limits,'b')
fplot(v3,limits,'g')
axis([0 10 0 10])
ylabel('rate')
xlabel('[S]')
legend('K=0.1','K=1','K=10','Location','SouthEast')
Later on I used this next bit of code to produce a different plot
%1) Plot a rate curve with a Eo value of 4, a k2 value of 0.03, a k-1
%value of 0.003, and a k1 value of 0.01.
k2 = 0.03;
Eo = 4;
k1 = 0.01;
kminus1 = 0.003;
Vmax = k2*Eo
Km = (kminus1+k2)/k1
v = @(S) Vmax*S/(Km+S);
limits = [0 100];
fplot(v,limits)
xlabel('[S]')
ylabel('rate')
What is happening is that the two plots are combining, even if I seperate them out as different sections and run the latter as it's own seperate thing. However, I know my code works to produce the plot I want as when I copy it into the command window or a seperate live file it works fine. So clearly these two are interacting but I don't know how. I tried changing the v in the second set of code to a q and plot fplot(q,limits) but that made no difference.
Help me wider community, you are my only hope.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Annotations finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!