필터 지우기
필터 지우기

Add variable Text to the end of the Arrow in a Loop

조회 수: 5 (최근 30일)
Dima
Dima 2011년 9월 30일
Hello, I want to ask if it is possibel to combine the '\downarrow' with a variable value in the following function:
text(s-7,Num(s,k),'\downarrow', 'VerticalAlignment', 'baseline','FontSize',5)
I normally use
{c}
instead of
'\downarrow'
to plot the values of the C variable at the specified places...I wonder how to put a down arrow followed by the value of the in each case??? I tired this version:
'\downarrow {c}'
and it just places the {c} text on the chart.
Thanks!!!
D

채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 30일
Are the values in C numeric or text?
Consider using sprintf(), perhaps in combination with strcat(), to construct the string.
One possibility:
strcat({'\downarrow '}, cellstr(num2str(C)))
  댓글 수: 2
Dima
Dima 2011년 9월 30일
thank you for your prompt reply...C is the number in ascending order....from 1 to 100.....this approach you recommended is applicable? do I assign strcat({'\downarrow '}, cellstr(num2str(C)))
to some variable?? and then place it in {}????
Dima
Dima 2011년 9월 30일
I works FABULOUSLY!))) THANKS A LOT!))

댓글을 달려면 로그인하십시오.

추가 답변 (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