How do I connect data points on log scale?

1 回表示 (過去 30 日間)
Jay Dee
Jay Dee 2015 年 1 月 18 日
コメント済み: Jay Dee 2015 年 1 月 18 日
I'm plotting data points using the loglog function. However, they are hardly visible. All I want to do is make a line that goes through all the data points but for some reason I can't figure out how to do this. The code is simple, it looks like this except with a lot more points:
loglog(3, 3.371779e-04, 5, 2.148437e-05, 7, 4.417304e-06, 9, 1.305630e-06)
Can someone please just tell me how to make a line that goes through all of these points?? I don't think it should be that hard...

採用された回答

dpb
dpb 2015 年 1 月 18 日
Like plot, loglog expects two vectors X and Y (or an array if multiple Y)
loglog(3:2:9, [3.371779e-04, 2.148437e-05, 4.417304e-06, 1.305630e-06])
  1 件のコメント
Jay Dee
Jay Dee 2015 年 1 月 18 日
thanks for the help

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

その他の回答 (1 件)

Chad Greene
Chad Greene 2015 年 1 月 18 日
Separate the inputs into x and y arrays:
x = 3:2:9;
y = [3.371779e-04, 2.148437e-05, 4.417304e-06, 1.305630e-06];
loglog(x,y)
  1 件のコメント
Jay Dee
Jay Dee 2015 年 1 月 18 日
thanks for the help.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by