What is done in this line? f = f(arrayfun(@(x) x.name(1), f) ~= '.');

2 visualizaciones (últimos 30 días)
Shaila parvin
Shaila parvin el 28 de Mayo de 2013
clc
clear all
close all
dirpath = 'E:\4-1\image-thesis\implementation\shaila\';
f=dir(fullfile(dirpath,'*.jpg'));
f = f(arrayfun(@(x) x.name(1), f) ~= '.');
for i=1:length(f)
a=imread(strcat(dirpath,f(i).name));
if (ndims(a)==2 | (a(:,:,1)==a(:,:,2) & a(:,:,2)==a(:,:,3)))
%if (ndims(a)==2)
figure;imshow(a)
end
end
What is done in this line?
f = f(arrayfun(@(x) x.name(1), f) ~= '.');

Respuesta aceptada

Matt J
Matt J el 28 de Mayo de 2013
Editada: Matt J el 28 de Mayo de 2013
It takes file names obtained from DIR and throws away those that begin with '.'

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by