Change Background color using [row,col]?
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi Everyone,
I'm trying to use [row,col] to find values between a certain range and then use get/set to set those values to different colors. Does anyone know how to fix this so that it works? I can't use uistyle. I'm working in matlab 2019b. Thanks in advance!
Edit i'm getting this error:
Error Using GUI after first time - "Error using handle.handle/set Invalid or deleted object."
% Threshold 1 (green)
[row,col] = find(uit.Data >= 0 & uit.Data < 43);
gr = get([row,col],'BackgroundColor');
set(gr,'BackgroundColor',[0 0.5 0]);
% Threshold 2 (yellow)
[row,col] = find(uit.Data >= 43 & uit.Data <= 44);
yel = get([row,col],'BackgroundColor');
set(yel,'BackgroundColor',yellow);
% Threshold 3 (red)
[row,col] = find(uit.Data == 45);
re = get([row,col],'BackgroundColor');
set(re,'BackgroundColor',red);
% Threshold 4 (black)
[row,col] = find(uit.Data == 0);
bl = get([row,col],'BackgroundColor');
set(bl,'BackgroundColor',[0.9 0.9 0.9]);
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!