check filename of the input image

2 ビュー (過去 30 日間)
Allen Ray
Allen Ray 2016 年 10 月 16 日
回答済み: Image Analyst 2016 年 10 月 16 日
I wanna make sure the filename of input image is same as what I want. I need it to get into if-else statement.
For example(some sort like this):
a = imread('img.jpg');
if(image_wanted == img.jpg) for(k =1:5) x(k) = k; end end

採用された回答

Image Analyst
Image Analyst 2016 年 10 月 16 日
use strcmpi:
if strcmpi(image_wanted, 'img.jpg')
% Name matches
else
% Name does not match.
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by