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 个评论

.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

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by