I want to read image name to be an string

10 次查看(过去 30 天)
I = imread ("28-30-50-30.jpg");
after I ran this function I will get the image in variable "I",
but I want to read name of this picture ("28-30-50-30.jpg") in string to do the next step in strsprit().
How can I do it??
  4 个评论
Stephen23
Stephen23 2020-1-8
编辑:Stephen23 2020-1-8
As you already noted in your question, I is an image. It is a numeric array. It is not a string, nor a character array, and it cannot be applied to functions that require strings or character arrays.
It is not clear what you expect to achieve.
Supwolf
Supwolf 2020-1-8
I want a code to run like this
-first get an image
-next read the name of the image
-then get the name of image
-and sprit them in each alphabet

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2020-1-8
imgNames = dir('*.jpg') ;
N = length(imgNames) ;
for i = 1:N
img = imgNames(i).name
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by