inserting image in a table
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Walter Roberson
el 21 de Abr. de 2019
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.)
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!