How to plot multivariable functions against each other?

1 visualización (últimos 30 días)
Max Springer
Max Springer el 19 de Jun. de 2018
Respondida: Star Strider el 19 de Jun. de 2018
Have defined to functions based on biological mechanisms and am trying to plot the two against each other (GF on the x-axis, ECM on y-axis) where the variables in the equations (x and y) are the possible concentrations of the molecules which are reactants. The rest of the constants are defined. For some reason I cannot find a way to plot them?
% Variable Initialization
x = linspace(0,10);
y = linspace(0,10);
% Parameters
v2fak = 0.05; v1fak = 0.04; k2fak = 0.1; k1fak = 0.1; fakt = 1;
kagf = 0.1; kdap1 = 0.15; vs2ap1 = 0.05; kafak = 0.1; vsap1 = 0.05;
GF = [kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y)))] / [vsap1 + vs2ap1 * ...
(y / (kafak + y)) - kdap1 * x];
ECM = (v2fak / v1fak) * (y / (k2fak + y)) * (k1fak + (fakt - y)) / ...
(fakt - y) - [kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y)))] / [vsap1 + vs2ap1 * ...
(y / (kafak + y)) - kdap1 * x];
plot(GF,ECM);

Respuesta aceptada

Star Strider
Star Strider el 19 de Jun. de 2018
Vectorize all the vector multiplications and divisions, and it works:
GF = (kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y)))) ./ (vsap1 + vs2ap1 * ...
(y / (kafak + y)) - kdap1 * x);
ECM = (v2fak / v1fak) * (y ./ (k2fak + y)) .* (k1fak + (fakt - y)) ./ ...
(fakt - y) - (kagf * (kdap1 * x - vs2ap1 * (y ./ (kafak + y)))) ./ (vsap1 + vs2ap1 * ...
(y ./ (kafak + y)) - kdap1 * x);
Also, use parentheses instead of square brackets unless you intend to define matrices with individual elements.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by