フィルターのクリア

How to find the x value at the maximum?

3 ビュー (過去 30 日間)
sophp
sophp 2018 年 2 月 7 日
編集済み: Jan 2018 年 2 月 7 日
Here is a MATLAB code to find the maximum of the Y_B (which is a function of
T and t) against t.
t = 0.2:0.1:20;
T = 600:2:850;
for i = 1:numel(T)
k1 = 1e7 .* exp(-12700 ./ T(i));
k2 = 5e4 .* exp(-10800 ./ T(i));
k3 = 7e7 .* exp(-15000 ./ T(i));
for j = 1:numel(t)
Y_B(i,j) = (k1/(k2-k1-k3))*(exp(-(k1+k3)*t(j))-exp(-k2*t(j)));
end
end
plot(t, max(Y_B, [], 1));
How do I find the corresponding value of T at the Y_Bmax and plot it against t?
  1 件のコメント
Jan
Jan 2018 年 2 月 7 日
編集済み: Jan 2018 年 2 月 7 日
As mentioned in your other thread, this is more efficient and nicer without a loop:
t = 0.2:0.1:20;
T = (600:50:850).';
k1 = 1e7 .* exp(-12700 ./ T);
k2 = 5e4 .* exp(-10800 ./ T);
k3 = 7e7 .* exp(-15000 ./ T);
Y_B = (k1 ./ (k2-k1-k3)) .* (exp(-(k1+k3) * t) - exp(-k2*t)); % >= R2016

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

採用された回答

Birdman
Birdman 2018 年 2 月 7 日
編集済み: Birdman 2018 年 2 月 7 日
t = 0.2:0.1:20;
T = 600:2:850;
for i = 1:numel(T)
k1 = 1e7 .* exp(-12700 ./ T(i));
k2 = 5e4 .* exp(-10800 ./ T(i));
k3 = 7e7 .* exp(-15000 ./ T(i));
for j = 1:numel(t)
Y_B(i,j) = (k1/(k2-k1-k3))*(exp(-(k1+k3)*t(j))-exp(-k2*t(j)));
end
end
[val,idx]=max(Y_B);
plot(T(idx), val,'-o');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by