MATLAB Answers

create my .mat file

1 view (last 30 days)
J A on 22 Apr 2019
I saw the next tutorial:
At the Demo 2 was doing with deep lerning a food detection. For this was use a .mat file.
I want to use the code for road sign detection but I don't know how to create my .mat file.
I have 25 images for input and I want to do a .mat file.
I searched on Internet and I found the following code.
%Generate mat file
srcFile = dir('..\ROAD-SIGN\*.jpg')
result = cell(1,length(srcFile))
for i = 1 : length(srcFile)
filename = strcat('...\ROAD-SIGN\',srcFile(i).name)
I = imread(filename);
%figure, imshow(I);
I = imresize(I,[273 273]);
result{i} = I;
%figure, imshow(result{i});
save images1.mat, result;
for j = 1:length(srcFile)
figure, imshow(result{j});
%Read mat file
for j =1 :length(srcFile)
filename = strcat('...\ROAD-SIGN\',srcFile(j).name);
I = imread(filename);
input = load('images1.mat',a);
figure, imshow(input.(a));
whos -file images1.mat
But it isn't working because in the main program is useing the layer attribut. In my code for a .mat file I don't have the layer attribute.
Can anyone help me with a solution, please?

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by