MATLAB Answers

import images with timestamps label

1 view (last 30 days)
ennes mulla
ennes mulla on 7 Jul 2021
Commented: Peter Perkins on 27 Jul 2021
Hi
I have images that have timestamp label, I want only to import only the timestamp and store in one colmun array without loading all images to spacework.
The images labeling has the follwing Shape: yyyy-mm-dd:HH:MM:ss.jpg
for instance 2021-07-05-14:17:05.jpg
Many thanks in advance
  3 Comments
Peter Perkins
Peter Perkins on 27 Jul 2021
DateString = datestr(N,fmt);
DateString = datenum(DateString);
DateString = transpose(DateString);
HistoryJune24th = datetime(DateString,'ConvertFrom','datenum')
seems very round-about. Can't say this strngly enough: Don't use datestr and datenum. If this is still part of your code, I suggest
HistoryJune24th = datetime(N,"Format",'yyyy-MM-dd-HH:mm:ss')

Sign in to comment.

Accepted Answer

Jonas
Jonas on 7 Jul 2021
Edited: Jonas on 7 Jul 2021
this stores all file names without the '.jpg' ending in the cell array 'names'
names=erase({dir('my/path/to/images/*.jpg').name},'.jpg');

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by