How can I request the filename of a colour image file from the user in Matlab code???

How to use matlab code to request the user to add a color image to my current and then load it as a data?? please help

 채택된 답변

function imageInput(imagename)
image = load(imagename)
After this, you can do whatever you want to do with the image. Remember that you have to name your function file the same name as your function.

댓글 수: 3

Does the (imagename) including the .gif /.jpg ?? for example cago.jpg?? Am i correct? Or type the location of the file where is locate such as C://Downloads/cago ???
on the other hand ,I have to add a color image wherever it located to become as my current data? What the code in Function file?? Thank you
I have only tried the said procedure a few times, as I am quite the novice when it comes to Matlab. However, I would pressume the image have to be located in your current matlab directory (same goes for your function and the file in which you use said function. Your data processing should be done in a separate document different from your function.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

질문:

2013년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by