variable color-text for "imtext" function...

조회 수: 9 (최근 30일)
Hayder
Hayder 2013년 8월 4일
I have used the "imtext" function successfully to display any string of text within an image. Here is a successful example for displaying the text "mean" at location (x,y) = (0.25,0.75) using a specific RGB color for the text "mean":
imtext(0.25,0.75,'\color[rgb]{0.5 0.25 0.1} mean');
Now let's assume that I have a vector: rgb_vector = [0.5 0.25 0.1]
If I try the following command, it fails to work:
imtext(0.25,0.75,'\color[rgb]{rgb_vector} mean');
I have tried to convert rgb_vector to string using "num2str" and "mat2str" but both failed to work. I also tried to convert the vector to a cell array using num2cell and mat2cell, but none of these solutions worked either.
Here are typical warning/error messages that I get:
{
Unable to interpret TeX string "\color[rgb]{rgb_vector} mean"
Unable to interpret TeX string "\color[rgb]{num2str(rgb_vector)} mean"
Unable to interpret TeX string "\color[rgb]{mat2str(vec)} mean"
Unable to interpret TeX string "\color[rgb]{num2cell(rgb_vector)} mean"
Unable to interpret TeX string "\color[rgb]{mat2cell(rgb_vector)} mean"
}
Would appreciate any solution that someone may have!
Thanks;

답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by