name must be a text scalar -凯发k8网页登录

45 次查看(过去 30 天)
marco pedata
marco pedataabout 21 hours 前
stephen23 ,about 19 hours 前
hi,
i wan to use the datetime() function to name a folder. moreover, i want to change the format with the replace() function and later access this folder via dir(). however, i get an error that says "name must be a text scalar". i suppose the reason lies in the replace function. is there any other way to do this?
actual_time = datestr(datetime('now')); % holt die aktuelle zeit
files = dir([actual_time '\*.txt']); % works
actual_time = fullfile(replace(actual_time, ':', '-'))
files = dir([actual_time '\*.txt']); % error
  2 个评论
marco pedata
marco pedata about 20 hours 前
thank you. it seems to work now :)

回答(0 个)

类别

find more on file operations in and

标签

community treasure hunt

find the treasures in matlab central and discover how the community can help you!

start hunting!

translated by

网站地图