Reputation: 1
The matlab code below has been converted to a DLL file and it's being used in c# program in visual studio. While running the c# program it's showing an error as
undefined variable or function name imtool, error in trail.m
trail.m
is the name of program in matlab.But when this "trail" is runned in matlab it's showing the desired output. Can you please find out a solution.
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
clc; % Clear command window.
clear; % Delete all variables.
close all; % Close all figure windows except those created by imtool
imtool close all; % Close all figure windows created by imtool.
Upvotes: 0
Views: 89
Reputation: 24127
The command imtool
is not supported for use with MATLAB deployment products, including MATLAB Compiler and MATLAB Builder NE for .NET. Typically, most regular MATLAB and toolbox commands are supported, but not prebuilt GUIs such as imtool
.
However, if the use of imtool
is within a block of code surrounded by if (~isdeployed)
, then this shouldn't be a problem, as it will not be executed by the deployed component.
Your code snippet is incomplete, and doesn't have an end
for the if
. Can you confirm whether your imtool
is within the if (~isdeployed)
block? Or perhaps, since you're attempting to close some imtool
windows, you have other uses of imtool
within trail.m
?
Upvotes: 2