MATLAB Answers


Neural Network in Matlab App Designer

Asked by Justin Primero on 12 Feb 2019
Latest activity Commented on by Kojiro Saito on 11 Jun 2019
Is it possible to incorporate a Neural Network into an app created from the Matlab App Designer?


Sign in to comment.

2 Answers

Answer by Kojiro Saito on 12 Feb 2019
 Accepted Answer

Yes, Neural Network (both shallow and deep neural networks) works with applications created by AppDesigner both for training and predict. Could you specify your use case, if possible?


I'm creating a graph through the use of a photorestistor operated by an Arduino. I would then extract numerical voltage values of the graph and record specific points of it in an excel file. The values would then be processed in a trained neural network for it to classify the graph that I generated. Is this possible? If so, how can I call a neural network into the AppDesigner?
Thank you for sharing your use case. Yes, it is possible in AppDesigner apps.
Here is one solution.
1. Train a neural network model and save the model as a mat file (for example, net.mat)
2. In AppDesigner, create a Private Property(net).
3. In a startup function, load the mat file and set as
net = load('net.mat'); =;
4. In a function callback which processes graph data (inputData), use classfiy with neural network.
[YPred, scores] = classify(, inputData);
This has been very helpful. Thanks a lot, Kojiro Saito.

Sign in to comment.

Answer by Pablo Salaverria on 10 Jun 2019

Dear all,
while creating an app using app designer I am not able to compeltelly deploy my trainned CNN. My main issue is wiht the function classify which should be valid with:
[YPred]= classify(,app.imds1);
Where is the trainned CNN, app.imds1 is the imageDatastore where all the images that I want to classify are stored.
The error message that I got is:
Error using classify (line 123)
Requires at least three arguments.
Meaning that the function classify is using a 2nd options instead of the one that I want it to use. Is there a way to make it work?

  1 Comment

I have just answered your question in this link. Please take a look.

Sign in to comment.