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

5 vues (au cours des 30 derniers jours)
Jamais avenir
Jamais avenir le 30 Jan 2015
Modifié(e) : John D'Errico le 31 Jan 2015
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?

Réponse acceptée

John D'Errico
John D'Errico le 31 Jan 2015
Modifié(e) : John D'Errico le 31 Jan 2015
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.

Plus de réponses (1)

Star Strider
Star Strider le 30 Jan 2015
The cputime function may be as close as you can get.
  2 commentaires
Jamais avenir
Jamais avenir le 30 Jan 2015
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 le 30 Jan 2015
Modifié(e) : Star Strider le 30 Jan 2015
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by