How to image one text file from many
Show older comments
I have a set of text files consisting of depth values named '00.txt', '01.txt', '02.txt' etc, and I have imported them as shown below:
Images=dir(fullfile('folder1\folder2\','*.txt'));
ImageD = fullfile({Images.folder},{Images.name});
for i = 1:numel(ImageD)
dataImage(:,:,i)=importdata(ImageD{i}).data;
end
Now I would like to image only one of the files. How can I do that?
2 Comments
DGM
on 9 Feb 2022
What do you mean "image a text file"? Are you trying to graph it?
Dinos Layiotis
on 10 Feb 2022
Accepted Answer
More Answers (1)
yanqi liu
on 10 Feb 2022
Images=dir(fullfile('folder1\folder2\','*.txt'));
ImageD = fullfile({Images.folder},{Images.name});
for i = 1:numel(ImageD)
dataImage(:,:,i)=importdata(ImageD{i}).data;
end
for i = 1 : size(dataImage, 3)
figure; imshow(mat2gray(dataImage(:,:,i)));
end
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
