How can I put images in a table using gui?
Show older comments
I need to create a table in matlab/gui where I have to put images in the first column of the table. Is that possible? I searched a lot for a code to help me but I couldn't find any.
Accepted Answer
More Answers (2)
Walter Roberson
on 6 Apr 2023
If you use traditional figures with traditional uitable() objects, then Yes, it is possible.
What you do in such cases is use a cell array of character vectors, and set each one to be HTML, such as
D{2,5} = '<HTMTL><IMG source="http://SOMEURL">'
However.... it is difficult to adjust the size of the cells. You can adjust column width, but column height is going to be automatically determined to be equivalent to one line in the text font (the scanner is just going to see text, not understanding that it is going to activate something.) So you can effectively only get fairly small images, on the order of 10-ish pixels high.
If you are using uifigure() with newer uitable() then there might be additional possibilities.
If you are using uifigure() then consider the possibility of using uihtml() objects https://www.mathworks.com/help/matlab/ref/uihtml.html beside the uitable(); see also https://www.mathworks.com/help/matlab/creating_guis/create-an-html-file-that-sets-data-or-responds-to-data-changes-from-matlab.html
Image Analyst
on 7 Apr 2023
Edited: Image Analyst
on 22 Nov 2025
1 vote
Perhaps try undocumentedmatlab.com
Categories
Find more on Data Import and Export in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

