필터 지우기
필터 지우기

inserting image in a table

조회 수: 15 (최근 30일)
Fatima Rashid
Fatima Rashid 2019년 4월 21일
답변: Walter Roberson 2019년 4월 21일
Hey, I want to add an image to the table and then in next cell add it's quantitative measure(found through quality metrics). How can that be done in matlab?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 4월 21일
With traditional figures (**not** App Designer), you create a uitable. The column that is going to contain the images has to be marked as character; the column for the quantitative measure can be numeric if appropriate.
Now, each cell entry that is going to have an image, code the content of the entry as (for example)
'<html><img="https://www.mathworks.com/help/examples/matlab/win64/MatlabLogoExample_05.png"></html>'
If you use a file: URL, be sure to put in file:// before the path and be sure to use any leading directory separator for the path. For example on my system, file://Applications/MATLAB_R2019a.app/something.png would not work: I would have to use file:///Applications/MATLAB_R2019a.app/something.png
Now, you will find that unless the image is quite small that most of it will be cut off. You can create wider columns programmatically, but creating taller columns is tricky unless you go in at the Java that underlies uitable .
Considering the size difficulties, you might find it easier to program a completely different method, such as tossing up some uicontrol style edit to the right of an axes that you put images on (see the XData and YData properties of image objects.)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by