How to plot multivariable functions against each other?

1 回表示 (過去 30 日間)
Max Springer
Max Springer 2018 年 6 月 19 日
回答済み: Star Strider 2018 年 6 月 19 日
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);

採用された回答

Star Strider
Star Strider 2018 年 6 月 19 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by