How can I plot a string input?
조회 수: 3 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
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
2022년 9월 29일
I assume you want to display.
display('David')
txt =input('What is your name','s');
display(txt)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!