简体   繁体   中英

Issues in using DLL files

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. 

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 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM