Is it possible to disable plot/figure generation in an entire script?

조회 수: 80 (최근 30일)
Andrew Reibold
Andrew Reibold 2014년 10월 27일
댓글: Adam Danz 2020년 1월 13일
This is more of a trivial request, but it would be convenient for me if there was a setting I could change before running a script that simply squelches all figure and plot creation.
Does anyone know if this type of thing exists?
  댓글 수: 1
gilles miet
gilles miet 2018년 12월 7일
Hi, In case you know which display functions are called, simply overload them by defing new dummy functions with same name and varargin.
e.g. for plot function:
Create a plot.m in current directory or in any custom path directory as follows:
function plot(varargin)
disp('doing nothing');
end
Ignore matlab warnings telling you you overload a Matlab built-in function (you are doing it on purpose)
When plot is called you get:
>> x=randn(1,10);
>> plot(x)
doing nothing
>>

댓글을 달려면 로그인하십시오.

채택된 답변

Doug Hull
Doug Hull 2014년 10월 27일
A sneaky way of kind of sort of doing this is:
set(groot,'defaultFigureVisible','off')
To undo this:
set(groot,'defaultFigureVisible','on')
It means the new figures will be visible off. It kind of does what you are looking for, kind of.
  댓글 수: 6

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by