Hi, how should I display the name for image. Only Name without the pathways.

1 view (last 30 days)
InfoImage = imfinfo(filename);
imgName = InfoImage.Filename;
app.FileNameEditField.Value = [imgName];
Thank you for your help.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Dec 2022
[~, imgName, extension] = fileparts(InfoImage.Filename);
Then use either imgName alone or [imgName, extension] if you want to preserve the extension.

More Answers (0)

Categories

Find more on Get Started with MATLAB 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!