フィルターのクリア

Plotting test time or train time?

2 ビュー (過去 30 日間)
Desiree
Desiree 2020 年 4 月 10 日
コメント済み: Desiree 2020 年 4 月 10 日
I be have an algorithm which has the O((n*log(n))/eps^2 + d*log^3(n)/eps^4) train time where eps and d here are fixed. I want to plot it varying the values of n from 10,000 to 60,000. How can I do it? Not sure if it is by tic toc or something else. Thanks in advance!

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 10 日
try this
d = 10;
Eps = 1; % eps in builtin MATLAB constant
O = @(n) (n.*log(n))/Eps^2 + d*log(n).^3/Eps^4;
n = linspace(10000, 60000, 100);
On = O(n);
plot(n, On);
xlabel('n')
ylabel('O(n)')
  1 件のコメント
Desiree
Desiree 2020 年 4 月 10 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by