필터 지우기
필터 지우기

making a text figure

조회 수: 24 (최근 30일)
aaa
aaa 2011년 7월 19일
Hi,
I'm trying to use the the following code to print some text onto a figure window. As an example, I am using the following line of code
figure;
text(0.5,0.5,'Hello world');
However, when I run the code, I get the error message:
??? Attempt to call constructor text with incorrect letter case.
however, using Text( ) does not work either.
if i try to use "doc help", it shows that i am doing calling this function correctly, but if i use "help text", matlab says
No help found for text.m.
How can i fix this?
thanks in advance

채택된 답변

Kelly Kearney
Kelly Kearney 2011년 7월 19일
It sounds like something might be overshadowing Matlab's text function. What do you get with this command?
which text -all
  댓글 수: 1
aaa
aaa 2011년 7월 19일
this is correct. i mistakenly named my own m file as text.m and it overshadows the built in function.
Thank you

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

추가 답변 (2개)

Nirmal Gunaseelan
Nirmal Gunaseelan 2011년 7월 19일
TEXT usually lives under $matlabroot\toolbox\matlab\graph2d\text - if you do not find it there, I'd re-install MATLAB.

aaa
aaa 2011년 7월 19일
Hi, is there another way i can print some text then? I don't think i would be able to reinstall matlab without contacting the system admin which could potentially take a very long time.
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 7월 19일
I agree with the other two: this problem is usually caused by having your own text() function.

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

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by