can you help me to calculate the number of multiplication and operation ,we used flops,
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ime sem
am 16 Nov. 2013
Bearbeitet: Walter Roberson
am 21 Jan. 2014
function i = pdga()
n=46;
factors = factor(n);
if length(factors) == 1
i = 1;
else
i = prod(factors(2:end));
end
end
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Nov. 2013
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!