xxsimRemovePlotFromWindow - Remove the specified plot from the specified window Syntax: retval = xxsimRemovePlotFromWindow(window,plot) Inputs: window = The unique ID or the name corresponding to the plot window from which the plot should be removed. plot = The unique ID or the name corresponding to the to be removed plot. Outputs: retval = returns true if the plot is removed from the window without error and false otherwise. Example: retval = xxsimRemovePlotFromWindow(2,4) - Remove plot with ID 4 from plot window with ID 2. - It is possible to replace the 4 with the name of the corresponding plot. - It is possible to replace the 2 with the name of the corresponding plot window. - retval is true if the specified plot is removed without error, false otherwise. - Note: The simulator should be open before calling this function. See also: xxsimAddPlotToWindow, xxsimOpenSimulator, xxsimGetPlotsFromWindow, xxsimGetPlotWindows Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl November 2015
0001 function retval = xxsimRemovePlotFromWindow(window,plot) 0002 % xxsimRemovePlotFromWindow - Remove the specified plot from the specified window 0003 % Syntax: 0004 % retval = xxsimRemovePlotFromWindow(window,plot) 0005 % 0006 % Inputs: 0007 % window = The unique ID or the name corresponding to the plot window from which the plot should be removed. 0008 % plot = The unique ID or the name corresponding to the to be removed plot. 0009 % 0010 % Outputs: 0011 % retval = returns true if the plot is removed from the window without error and false otherwise. 0012 % 0013 % Example: 0014 % retval = xxsimRemovePlotFromWindow(2,4) 0015 % 0016 % - Remove plot with ID 4 from plot window with ID 2. 0017 % - It is possible to replace the 4 with the name of the corresponding plot. 0018 % - It is possible to replace the 2 with the name of the corresponding plot window. 0019 % - retval is true if the specified plot is removed without error, false otherwise. 0020 % - Note: The simulator should be open before calling this function. 0021 % 0022 % See also: xxsimAddPlotToWindow, xxsimOpenSimulator, xxsimGetPlotsFromWindow, xxsimGetPlotWindows 0023 % 0024 % Author: Controllab Products B.V. 0025 % email: info@controllab.nl 0026 % Website: http://www.controllab.nl 0027 % November 2015 0028 0029 %------------- BEGIN CODE -------------- 0030 0031 % Check the obtained amount of input arguments. 0032 if(nargin>2) 0033 error('Too many input arguments were specified.'); 0034 elseif(nargin<2) 0035 error('Too little input arguments were specified.'); 0036 endif; 0037 0038 % Check if the input is a string 0039 if(!isnumeric(window) && !ischar(window)) 0040 error('Please specify a number as ID or a name as string for the plot window'); 0041 elseif(!isnumeric(plot) && !ischar(plot)) 0042 error('Please specify a number as ID or a name as string for the plot'); 0043 endif; 0044 0045 windowID = xxsimGetPlotWindowIDFromName(window); 0046 0047 plotID = xxsimGetPlotIDFromName(windowID,plot); 0048 0049 % and make the actual call to 20-sim 0050 retval = xrlinvoke('xxsim.plot.removePlotFromWindow',struct('windowID',int32(windowID),'plotID',int32(plotID))); 0051 0052 end 0053 %------------- END OF CODE --------------