Comparision of data names

1 visualización (últimos 30 días)
Veilchen1900
Veilchen1900 el 7 de Mayo de 2017
Comentada: Veilchen1900 el 9 de Mayo de 2017
Hi, I want to read images into the workspace and compare the image names with the image names stored in a cell array. My aim is to get the row from the cell aray where the image names are identical. The cell array contains data from an excelsheet (first column = name of image, second-fifth columns = values). With the code below I only get the name of the first image in dir. How do I get the position of the second, third,..image (stored in dir) from the cell array? Thanks in advance.
My code:
files = dir('*.tiff');
a=files.name
t={a}
[rn,cn]=find(strcmp(CellArray,t))

Respuesta aceptada

Jan
Jan el 8 de Mayo de 2017
Editada: Jan el 8 de Mayo de 2017
t = {files.name};
[Lia, Locb] = ismember(CellArray, t);
Or perhaps:
[Lia, Locb] = ismember(CellArray(:, 1), t);
Maybe:
[Common, Index] = intersect(CellArray(:, 1), t);

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by