I am running a MATLAB script in the background using the command line:
nohup matlab -nodisplay < scriptname.m > /dev/null &
The script integrates an ODE with N sets of different initial conditions, i.e. it loops N times. It takes days to run so I would like to output the progress, say every 10% completion. I've written a simple if statement:
if mod(n_th_loop,complete_out) == 0 fprintf('%2.2f %% complete', 100*n_th_loop/N); end
When running the script inside MATLAB, the percentage completion is printed out as I intended. However, I cannot get anything to print out into the linux terminal when I run the script in the background. I have also tried using disp(...), but have exactly the same problem.
Is there any way to run a MATLAB script in the background, but print messages to the linux terminal?
Sign in to answer this question.