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!