MATLAB Answers

How can I load the .mat file in GUI?

23 views (last 30 days)
Nazia Hameed
Nazia Hameed on 16 Oct 2017
Commented: Nazia Hameed on 17 Oct 2017
I have train alexnet and save it into .matfile. when I load that file to classify an image it is working fine like this
clear all;
clc;
load all.mat;
[FileName,PathName] = uigetfile('C:\Users\NH529\MATLAB\Deep learning\Images\*.jpg');
I = (imread([PathName '\' FileName]));
I=imresize(I, [227 227]);
label = classify(myNet,I);
finallabel=categorical(label);
imshow(I),title(sprintf('%s', finallabel));
But when I load this .matfile in the GUI it is giving me an error. How can I load it into GUI file. I have searched and tried the available answers but they didn't work
How can I solve this problem? Please help me

  5 Comments

Show 2 older comments
Stephen Cobeldick
Stephen Cobeldick on 17 Oct 2017
"I have used this variable in classification. The code where I used this variable is as"
Nope, because you never pass that variable to that function. It does not exist inside the workspace of pushbutton2_Callback because you have not passed that variable to that workspace.
I would recommend that you use nested functions or guidata. Read more here:
You will find many threads on this topic, with complete working example. Just search this forum.
Nazia Hameed
Nazia Hameed on 17 Oct 2017
ok, thanks. let me check and I will let u know. Thankyou so much.
Nazia Hameed
Nazia Hameed on 17 Oct 2017
thankyou so much. Problem solved. Stay blessed.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!