Colorize table cells upon matrix of logical values

4 ビュー (過去 30 日間)
Matt
Matt 2015 年 10 月 18 日
コメント済み: Jan 2015 年 10 月 18 日
Hello guys,
I would like to know how can I colorize the cells of a table that I have in a GUI upon a matrix values.
In details, I have a matrix with the same size as my table of course, full of 0 and 1, so I would like to tell Matlab to change the background color of my table if there is a 1 in my "color matrix".
How can I do that?

回答 (1 件)

Jan
Jan 2015 年 10 月 18 日
  2 件のコメント
Matt
Matt 2015 年 10 月 18 日
Thank you! Looks fairly complicated. Yes I am talking about a uitable. My issue is that I don't want to colorize whole rows or columns. Just specific cells. Colorizing the cell values would do it as well but I think it is just the same problem.
Jan
Jan 2015 年 10 月 18 日
You can use the HTML method to set the background color of single cells also. It is neither nice nor trivial, but you can hide the ugly details in a dedicated function. I'd expect to find a solution in the FileExchange. A severe problem is, that the cells can contain strings only, neither numbers nor checkboxes.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by