Struct contents reference from a non-struct array object.

for t=1:length(rcFiles)
filename=strcat('C:\MATLAB\R2017a\bin\dataset\',rcFiles(t).name);
b=gorsel(filename,t);
end
Struct contents reference from a non-struct array object.

4 Comments

.m
function [output]=gorsel(i,artis)
input=imread(i);
% figure,imshow(input);
j=imnoise(input,'salt & pepper',0.02);
k=medfilt2(j);
filename = ['C:\MATLAB\R2017a\bin\Median' num2str(artis,'%d') '.jpg'];
imwrite(k,filename);
% do something with img
i=imread(filename);
level=graythresh(i);
bw=imbinarize(i,level);
filename2= ['C:\MATLAB\R2017a\bin\Otsu' num2str(artis,'%d') '.jpg'];
imwrite(bw,filename2);
output=bw;
end
The only place I see a struct content reference is in the first line inside the loop. Are you sure rcFiles is indeed a struct?
It is recommended that you use fullfile() instead of those concatenations of strings.
Okey rcFiles a struct ı am solution the problem Thank you for your interest...... I solved the problem

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Asked:

on 16 Nov 2017

Commented:

on 17 Nov 2017

Community Treasure Hunt

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

Start Hunting!