Taking number out from the image name.

1 回表示 (過去 30 日間)
Muhammad Farhan  Mughal
Muhammad Farhan Mughal 2020 年 5 月 17 日
In my MATLAB code i browse for images using uiget
[fn, pn] = uigetfile('*.jpg;*.tif');
the variable fn is the name of image '2034.jpg'
Is there a method to take the digit "2034" out an assign it to integer variable such as
a = 2034
Thank you

採用された回答

KSSV
KSSV 2020 年 5 月 17 日
[d,name,ext] = fileparts(fn) ;
a = str2num(name) ;
  1 件のコメント
Muhammad Farhan  Mughal
Muhammad Farhan Mughal 2020 年 5 月 18 日
Thank you KSSV for your response.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by