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 Center および File ExchangeMathematics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by