필터 지우기
필터 지우기

find a digit in string

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2012년 12월 28일
i have a folder named "inputImages" it contains 5 images named image1, image2 ... image5
i have a variable which contains a digit... if that digit contains in any of the names i want that image to get displayed in a figure...
example
variable=2; then image2.jpg should get displayed....
please can someone help me how to get the name of the image that contains the digit....

채택된 답변

Matt J
Matt J 2012년 12월 28일
name=['image' num2str(variable) '.jpg'],

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 28일
variable=2
file=sprintf('image%d',variable)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by