필터 지우기
필터 지우기

How can I plot a string input?

조회 수: 3 (최근 30일)
Mohammad Rastegarpanah
Mohammad Rastegarpanah 2022년 9월 29일
댓글: Matt J 2022년 10월 10일
Hello,
How can I plot a string input?
prompt = "What is your name";
txt = input(prompt,"s");
if isempty(txt)
txt = 'Enter your name again.';
end
>> txt =
'MAX'
I want to automatically plot the received string.

채택된 답변

David Hill
David Hill 2022년 9월 29일
figure
ax=gca;
t = text(0.5,0.5,'David');
s = t.FontSize;
t.FontSize = 12;
ax.Visible='off';
  댓글 수: 2
Mohammad Rastegarpanah
Mohammad Rastegarpanah 2022년 9월 29일
Is it possible to extract X and Y for each letter as a list?
Matt J
Matt J 2022년 10월 10일
No, the text displayed on the plot by the text() command isn't formed from an underlying set of x,y points that can be plotted.

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

추가 답변 (1개)

David Hill
David Hill 2022년 9월 29일
I assume you want to display.
display('David')
David
txt =input('What is your name','s');
display(txt)
  댓글 수: 1
Mohammad Rastegarpanah
Mohammad Rastegarpanah 2022년 9월 29일
Thanks for your response. What I looking for is to plot the output not display it.

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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by