can you help me to calculate the number of multiplication and operation ,we used flops,

2 ビュー (過去 30 日間)
function i = pdga()
n=46;
factors = factor(n);
if length(factors) == 1
i = 1;
else
i = prod(factors(2:end));
end
end

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 16 日
Sorry, no, on modern systems is not not possible to meaningfully calculate FLOPS.
Also, the method that factor() uses to determine the factors is not documented. You could peak at the source code for MATLAB's factor(), but keep in mind that that code is one possible implementation and not necessarily the most efficient implementation. It is not known what the most efficient possible factorization is; see http://en.wikipedia.org/wiki/Integer_factorization#Difficulty_and_complexity

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by