Why does Matlab R2013b display backgroundcolor in RGB format ?

6 vues (au cours des 30 derniers jours)
shweta shanbhag
shweta shanbhag le 12 Mar 2015
Commenté : shweta shanbhag le 12 Mar 2015
I am using MATLAB 2013b .I set the background color of a block by : right clicking on the block>> Format>> Backgroundcolor>>Green. But when I try to get the color of the block from the command window, it gives the color in RGB format and not as green .
>>get_param(gcbh,'Backgroundcolor')
ans= [0.000000, 0.819608, 0.000000]
Now I color another block and try to get the color property
>> get_param(gcbh,'BackgroundColor')
ans =
green
Could you please explain why there is a difference and how could I solve this ?

Réponses (1)

Jan
Jan le 12 Mar 2015
All we know about the difference between the 2 examples is that you color "a block" at first and "another block" at second.
Please provide more information, e.g. if the order matters or if you are talking of different blocks. The Matlab and OS version might be useful also.
Please explain also, why the observed effect is a problem, because currently it is hard to suggest a workaround, when it is not clear, why your work is impeded by this detail.
  1 commentaire
shweta shanbhag
shweta shanbhag le 12 Mar 2015
I have already mentioned the matlab version R2013b .OS is Windows 7. There is no pattern as such to color the blocks . My purpose is to check if the color of the block is green . If not I want to throw an error message . But when I try to get the color property it shows RGB format and I get the error message any way even if it is green . Below is the code :
blockcolor= get_param(<block>,'backgroundcolor');
if ~strcmp(blockcolor,'green')
disp(' Block color is not green');
end

Connectez-vous pour commenter.

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by