Semilogx function giving a linear scale

5 ビュー (過去 30 日間)
Vedant Kudalkar
Vedant Kudalkar 2022 年 4 月 26 日
コメント済み: Vedant Kudalkar 2022 年 4 月 26 日
I am trying to make a semilog function of my data, by setting the x data, and producing the y data based on an equation. The code below is what I currently have.
S = [10^-2 10^-1 1 10 100 1000 10^4]; % Remdesivir concentration, in uM
Km = 0.5; % Equilibrium constant, in uM
Vmax = 0.82; % max reaction velocity, in
Vobs = zeros(1,length(S)); % preallocates a vector for the observed velocity.
% itterates throught each potential value of Vobs, produces an array of
% values for Vobs to graph
for i = 1:length(S)
Vobs(i) = (Vmax*S(i))/(S(i) + Km); % calculates Vobs from Vmax, Km, and the S concentration at a specified concentration
end
% Maintains all drawings
hold on
semilogx(S,Vobs)
xlabel ('Remdesivir concentration (uM)');
ylabel('Vobs (uM)');
title('Vobs vs Remdesivir concentration (uM)- ' )
What am I doing wrong?

採用された回答

VBBV
VBBV 2022 年 4 月 26 日
S = [1e-2 1e-1 1 10 100 1000 1e4]; % Remdesivir concentration, in uM
Km = 0.5; % Equilibrium constant, in uM
Vmax = 0.82; % max reaction velocity, in
Vobs = zeros(1,length(S)); % preallocates a vector for the observed velocity.
% itterates throught each potential value of Vobs, produces an array of
% values for Vobs to graph
for i = 1:length(S)
Vobs(i) = (Vmax*S(i)/(S(i) + Km)); % calculates Vobs from Vmax, Km, and the S concentration at a specified concentration
end
% Maintains all drawings
semilogx(S,Vobs)
xlabel ('Remdesivir concentration (uM)');
ylabel('Vobs (uM)');
title('Vobs vs Remdesivir concentration (uM)- ' )
grid
  1 件のコメント
VBBV
VBBV 2022 年 4 月 26 日
Delete hold on line . It produces a figure window with linear scale.

サインインしてコメントする。

その他の回答 (1 件)

Rifat
Rifat 2022 年 4 月 26 日
Hi Vedant,
You're very close. I would use the following sequence. Just to be sure, you should define the 'XScale' as a 'log' axis.
hfig = figure;
ax1 = axes('XScale','log','YScale','linear','Parent',hfig);
hold(ax1,'on');
tr1 = semilogx(S,Vobs,'Parent',ax1);
  1 件のコメント
Vedant Kudalkar
Vedant Kudalkar 2022 年 4 月 26 日
This works as well, thank you so much!

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by