loglog plot at high numbers

2 ビュー (過去 30 日間)
Benjamin Cowen
Benjamin Cowen 2016 年 2 月 5 日
回答済み: Walter Roberson 2016 年 2 月 6 日
Hi, I am having trouble plotting something in loglog plot.
I want to make a plot of n vs. T where n goes from 10^16 to 10^38 m^-3 and T goes 1 - 10^5 eV
And I have the equation 7.4 * sqrt (T/n);
How can I do this? I keep playing with the variables but I keep getting that my variable is too large etc.

回答 (2 件)

John D'Errico
John D'Errico 2016 年 2 月 5 日
Must not be possible then. :)
n = 10.^(rand(1,100)*22 + 16);
T = 10.^(rand(1,100)*5);
loglog(T,n,'o')
  1 件のコメント
Benjamin Cowen
Benjamin Cowen 2016 年 2 月 5 日
but how do i plot it with my equation?

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


Walter Roberson
Walter Roberson 2016 年 2 月 6 日
The equation 7.4 * sqrt (T/n) involves both of your input variables n and T, so you are effectively asking for a 3D plot rather than a 2D plot.
n = logspace(16, 38);
T = logspace(0, 5);
[Gn, GT] = ndgrid(n,T);
eqn = 7.4 * sqrt(GT./Gn);
surf(Gn, GT, eqn, 'edgecolor', 'none');
set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'log')
but you will not find the coloring to be interesting because coloring is based upon the original values not upon log() of the values. You might prefer
surf(Gn, GT, log(eqn), 'edgecolor', 'none');
set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'linear')

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by