Undefined function or method 'sim' for input arguments of type struct

13 次查看(过去 30 天)
I have created a standalone using deploytool function. It contains four classifiers namely a neural network(ann), SVM architecture,knn and ensemble(again a neural network).
The work flow is as following..
1)get the input from the user
2)load matlab.mat %--this contains my networks, svm architecture and the two matrices(training vector and training target for knnclassify). This file is explicitly called by the main function.
3)classify the input
4)output is generated %-- this approach worked perfectly fine wen run through the editor.. but after compilation wen run thro command command prompt i get the following error msgs..
Class':all:' is an unknown object class. Object ann of this class has been converted to a structure.
Warning: Could not find appropriate function on path loading function handle C:\Program Files(x86)\MATLAB\R2007b\toolbox\bioinfo\biolearning\private\linear_kernel.m>linear_kernel
Class':all:' is an unknown object class. Object ann of this class has been converted to a structure.
Undefined function or method 'knnclassify' for input arguments of type'double'
In the deploytool function i added two files under other files option 1)matlab.mat 2)gui.fig
Any help would be appreciated.. Thanks in advance

采纳的回答

Kaustubha Govind
Kaustubha Govind 2011-3-24
Solution 1-16DQNH might be of help.
  3 个评论
Kaustubha Govind
Kaustubha Govind 2011-3-24
My guess is that MATLAB Compiler is not adding some Neural Network Toolbox related classes to the CTF archive. Declaring the directive forces all relevant classes to be added to it.
Ram
Ram 2011-3-25
I just followed that solution and it worked!!
and it solved the knnclassify issue too :)
Thanku so much Kaustubha and Walter:)

请先登录,再进行评论。

更多回答(4 个)

hamdi
hamdi 2011-8-31
can you explain again the solution Thanks in advance
  1 个评论
Walter Roberson
Walter Roberson 2011-8-31
The solution is to put the line
%#function network
before the load() statement.
This tells the compiler that even though it cannot see any variables of class network being created, that it needs to include the class definition because some network variables are going to "appear" in the workspace (in this case, put there by load() )

请先登录,再进行评论。


hamdi
hamdi 2011-9-3
thank you, but this time it displays:
warning: An error occurred when running a class's loadobj method.the object that was loaded from the MAT-file was a copy of the object before the loadobj method was run. The rest of the variables were also loaded from the MAT-file.The encountered error was: error using ==> feval Undefined function or method 'traingdx' for input arguments of type 'char'.
  1 个评论
Walter Roberson
Walter Roberson 2011-9-3
NN training functions cannot be compiled (and that is not likely to change any time soon.)
http://www.mathworks.com/products/compiler/compiler_support.html

请先登录,再进行评论。


hamdi
hamdi 2011-9-7
and so what's the solution ??
  1 个评论
Walter Roberson
Walter Roberson 2011-9-7
There is no solution. You are trying to do something (compile a program that trains a neural net) that Mathworks prohibits for commercial reasons.
Compiled programs can work with pre-trained neural nets, but cannot train neural nets.

请先登录,再进行评论。


David
David 2012-2-27
I have the same problem with
close_system and get_param
For instance, my GUI contains the command
close_system(model_name,0);
This works fine in case I run the GUI directly in the MATLAB editor.
But after having compiled it to a standalone application. I receive
??? Undefined function or method 'close_system' for input arguments of type
'char'.
(model_name is the name of the SIMULINK model I want to close).
I tried use
%#function simulink
close_system(model_name,0);
but nothing changed.
Thanks in advance for any help!
David
  4 个评论
David
David 2012-2-27
Thanks for the quick reply, Walter & Kaustubha.
Right now I am using the deploytool.
I will check the possibilities with Simulink Coder
Thanks again,
David
David
David 2012-2-27
As far as I understand, there is no possibility to develop a standalone application of a GUI which compiles a given SIMULINK model, right?
Thanks for the help ...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by