MATLAB runtime
Mostra commenti meno recenti
I am running a matlab function that requires processing a huge number of data that can take hours or even days. Is there a way for us to check the progress of our matlab function, i.e. the approximate time it will require MATLAB to finish computing the function?
Thanks!
1 Commento
Hugo
il 8 Mar 2011
Risposta accettata
Più risposte (5)
John
il 8 Mar 2011
1 voto
i would look at the help for 'waitbar' if you want some kind of indication of where the program is. in addition if you are using loops you could just print out the loop index to see where the program is (or any other comment that you want).
pausing the program could be a little tricky. you could just use the 'pause' function to halt execution at some point and wait for the user to continue. you could then save off all variables in the workspace and close matlab. the next time you run the program load in all of those variables and continue execution from where you left off
Walter Roberson
il 8 Mar 2011
1 voto
If you have a graphics display, and if you can edit the code, then you can add waitbar() . The standard waitbar() does not provide any time estimates, but perhaps one of the ones in the Matlab File Exchange (FEX) does.
If you do not have a graphics display but can edit the code, you can use tic() and toc() to time loops and then multiply by the number of loops remaining to estimate the time requirement.
If you have a program already running and you did not put in any code to help you determine the time or progress, then there is no mechanism to examine the progress.
There is no Mathworks supplied mechanism to save the state of a program that is running and allow it to be resumed later. If you need something like that, then your program will need to write "checkpoint" information out from time to time, and then upon resumption will need to read in the last checkpoint and carry on from there.
One thing that might help you is to use calls to the fairly new oncleanup() facility. oncleanup() is invoked even if you control-C a program, I believe. The routine you designate in oncleanup() could save the state of important variables before allowing the variables to be cleared.
Andreas Goser
il 9 Mar 2011
1 voto
And I can't hold back my suggestion to users with code that runs days to see whether parallel and distributed computing with MATLAB can speed up computations.
Hugo
il 8 Mar 2011
0 voti
ravindra mg
il 26 Ott 2020
0 voti
i have downloaded matlab and i dont know how to use it to run matlab code
3 Commenti
Walter Roberson
il 26 Ott 2020
Launch MATLAB. When the graphical interface comes up, at the command line you can use "cd" to change directories; alternately if you have the folder view open, you can click to change directories. [The folder view can be run from the command line by using the command filebrowser ]
When you are in the directory where your code is, you can go to the command line and type the name of the script or function you want to run. Alternately, if you have the folder view open, you can double-click on a function or folder to open it in the editor, from where you can press the big green Run button.
However: it is common for functions to need input arguments. It maybe be necessary to assign variables at the command line and then invoke the function at the command line passing in the appropriate arguments.
ravindra mg
il 26 Ott 2020
cannot launch matlab, that's the problem. how do i launch it? i have downloaded the runtime files and ran setup. the files are in a folder but with no clue as how to launch the code builder. any helpwould be appreciated
Walter Roberson
il 26 Ott 2020
The MATLAB runtime can only be used to run pre-compiled MATLAB code. The runtime does not need to be started by itself: it will be started automatically by the pre-compiled code.
To run MATLAB .m or .mlx source code or Simulink models, you need MATLAB itself, not just the runtime.
There has never been a free version of MATLAB.
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!