MATLAB: Do I get a warning when I load a neural network object in a compiled application

classcompilercompilingconvertedloadMATLAB CompilerNetworkobjectstructurewarning

I have stored neural network objects in a MAT file and have created and compiled the following function:
function try_to_open
load my_nn_objs.mat;
Executing try_to_open inside of MATLAB works as expected. However if I compile the function using the following command:
mcc -m try_to_open.m
I get the following warning:
Warning: Class ':all:' is an unknown object class. Object '' of this
class has been converted to a structure.

Best Answer

To make the compiler aware of the neural network objects, modify the following directive in your function:
%#function network

For example:
function try_to_open
%#function network
load my_nn_objs.mat;