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 commentaires

.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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by