Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

New in matlab: Directories

1 Ansicht (letzte 30 Tage)
Marcus Vinicius Souza
Marcus Vinicius Souza am 12 Mär. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi all. I have a trouble in search an directory...basically i dont know how it can works.I need found a directory and aplly a function bwmorph in all itens inside. can any1 help me? Here is my scratch :
function [base,nomes] = read_data(save)
if(nargin~=1)
save = false;
end
%Seleciona o Diretorio onde as imagens estão.
dirimg = uigetdir;
if(dirimg ~=0)%vê se nao cancelou
ct = 1;
nomedir = dor(dirimg);
for i = 3: size(nomedir)
saida = str2double(nomedir(i).name);
diretorio = strcat(dirimg,'\',nomedir(i).name);
imagens = dir(diretorio);
for j = 3: size(imagens)
nomeimagem = strcat(diretorio, '\', imagens(j).name);
img = imread(nomeimagem);
temp = '';
temp = strcat(temp, nomedir(i).name, '\', imagens(j).name);
img = bwmorph(img,'skel',Inf);
if (salvar)
nome = strcat(dirimg, 'N\', nomedir(i).name, '\' , imagens(j).name);
imwrite(img, nome, 'TIF');
end
end
end
end
thanks!
  2 Kommentare
Jan
Jan am 12 Mär. 2012
What is your question? Does the code run or do you get an error message? What is the "dor" command?
Image Analyst
Image Analyst am 12 Mär. 2012
And what is "salvar" "saida" "temp" and "ct"? All are either undefined or unused.

Antworten (1)

Image Analyst
Image Analyst am 12 Mär. 2012

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by