0

My function calls code from other functions I did not write those but I know what they do. One of them is .p Matlab file with obfuscated content.

I am doing batch processing of a number of files. I want to write the figures directly to file without display. So I can go through them separately.

Any ideas on how to achieve this.

Thanks!

indiv
  • 17,306
  • 6
  • 61
  • 82
Rigusorio
  • 15
  • 7

2 Answers2

0

Script to save matlab figures to a specified directory

The above link works but I still want to avoid displaying the figures at all. Directly print to file. But the work around can simply close all open figures after that loop.

Rigusorio
  • 15
  • 7
0

In your script, as soon as you create the figure, set its visibility to off.

For example:

figure(28732);
set(28732,'visible','off'); %Now the figure is not shown

You can now work with the figure, plot, save etc, without the visual clutter or system overhead of displaying it.

If you want ALL of your figures to start without visibility, you can set the default property, as follows:

set(0,'DefaultFigureVisible','off').

This will cause all generated figures to be generated without visibility. (Note, this will be very confusing is you forget that this property is set.)

You should still close the figure as soon as possible in the script, as a part of good memory management.

Pursuit
  • 12,285
  • 1
  • 25
  • 41