How to use log scale with fimplicit

12 ビュー (過去 30 日間)
lorenzosilvestri1998
lorenzosilvestri1998 2022 年 8 月 18 日
Hi everyone, I have to plot an implicit equation and I'm using fimplicit:
fimplicit(@(x,y) cosh((log(2)*(x-1))./((x+1).*y)) - (1/2)*exp(log(2)./y), [1 1000 0 1])
that's ok but I need it on log scale on the x-axis. Is it possibile to use semilogx in this case or something similar?
Thx :)
lorenzo

採用された回答

Torsten
Torsten 2022 年 8 月 18 日
編集済み: Torsten 2022 年 8 月 18 日
x = 0:0.1:1000;
fun = @(x,y) cosh((log(2)*(x-1))./((x+1).*y)) - (1/2)*exp(log(2)./y);
options = optimset('Display','none');
tic
y = fsolve(@(y)fun(x,y),0.5*ones(size(x)),options);
toc
Elapsed time is 21.418050 seconds.
tic
y = arrayfun(@(x)fsolve(@(y)fun(x,y),0.5,options),x);
toc
Elapsed time is 4.687107 seconds.
semilogx(x,y)
  1 件のコメント
lorenzosilvestri1998
lorenzosilvestri1998 2022 年 8 月 18 日
Thank you :)

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 8 月 18 日
fimplicit(@(x,y) cosh((log(2)*(x-1))./((x+1).*y)) - (1/2)*exp(log(2)./y), [1 1000 0 1])
set(gca, 'XScale', 'log')
  1 件のコメント
lorenzosilvestri1998
lorenzosilvestri1998 2022 年 8 月 18 日
Thank you :)

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

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by