What is the new syntax of flops(0) and qp() in Matlab 2014?

조회 수: 5 (최근 30일)
Jamais avenir
Jamais avenir 2015년 1월 30일
편집: John D'Errico 2015년 1월 31일
I am running an old Matlab code, i.e., Version 5, and it seems some of the syntaxes have been changed in the newer versions of Matlab. I have Matlab 2014 and Want to know what is the new syntax for the code flops.
First I have some problems about flaps command which seems to be removed from newer version. So what I have as a code about it is bellow, Just the necessary parts are posted, Please tell me how can I modify it for running on new Matlab.
flops(0) % and few lines after
initial_flops = flops;
Flop = [Flop, flops];
fprintf(' Number of flops in initial calculations: %i\n\n',initial_flops);
disp(' beta #flops(in K) ')
disp(Flop_report)
net_flops
Also, I would like to know was qp() an old function in Matlab 5? If yes what is its alternative in New versions of Matlab?

채택된 답변

John D'Errico
John D'Errico 2015년 1월 31일
편집: John D'Errico 2015년 1월 31일
Sorry, but flops simply no longer exists. There is NO replacement for it. Flops returned an estimate of the number of floating point operations in a code, but with so many things being multi-threaded, etc., it no longer makes sense.
As for qp, look at quadprog from the optimization toolbox, which replaced it quite a few years ago. I can't really tell you what to change to use quadprog from qp, since I have no idea how qp was called, it was so long ago. Just read the help, which is quite good. It will be pretty similar to qp.

추가 답변 (1개)

Star Strider
Star Strider 2015년 1월 30일
The cputime function may be as close as you can get.
  댓글 수: 2
Jamais avenir
Jamais avenir 2015년 1월 30일
Thanks, Would you tell me how can I modify the part of code regarding to flops command?
Also, Do you know about qn()? Was it an old matlab function?
Star Strider
Star Strider 2015년 1월 30일
편집: Star Strider 2015년 1월 30일
I’m not certain what the flops function was doing in your code. (I don’t remember ever using it when it was available.) Your ‘Flops’ variable seems to be keeping track of the individual instances. I would experiment with the example in the cputime documentation to see how that best fits with your code. All the documentation on flops has vanished, so I can’t say how best to use cputime in its place.
I can’t find anything at all on whatever ‘qn’ is. I don’t ever remember having heard of it. It may be a user function that should be part of whatever scripts you’re using.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by