Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

can you help me to ploting the number of operations and time of execution

조회 수: 1 (최근 30일)
ime sem
ime sem 2014년 1월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
function pgdA
n=1000;
i=45;
while mod(n, i)~=0;
i=i-1;
end
flops mod(n,i);
plot mod(n,i);
  댓글 수: 3
Walter Roberson
Walter Roberson 2014년 1월 21일
"flops" is "floating point operations per second". There was a time when it had meaning in computers, but it does not have much meaning now.
Walter Roberson
Walter Roberson 2014년 1월 21일
As I have indicated in multiple posts, "flops", floating point operations per second, is not meaningful in modern computers, and there is no way to calculate it now.
If, though, you wanted to count "actions" like you did in http://www.mathworks.co.uk/matlabcentral/answers/105512-plotting-the-number-of-actions-for-ex-i-i-1-action-pgd-n-i-action-pgd-n-action then we might be able to help you, provided that you indicate all the different "actions" that you want to be counted individually.
Please note that your code has nothing to do with finding "mod", and is instead an algorithm for finding the greatest divisor of "n" that is at most "i"; with those particular values it would be 25 that would be left for "i"

답변 (1개)

Paul
Paul 2014년 1월 21일
Do you mean something like this:
n=10000;
i=47;
j=0;
while mod(n, i)~=0;
if(j==0)
tic
end
i=i-1;
j=j+1;
t(j)=toc;
tic
end
j=1:j;
plot(j,t),xlabel('iteration number'),ylabel('time [s]');

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by