I have a plot of variables and a variable called 'name' which contains a string. I want to have a text box display the string contained in the variable named. I have the following code:
figure
plot(SR,Pcr)
title('Critical Buckling Load vs Slenderness Ratio')
xlabel('Slenderness Ratio')
ylabel('Critical Buckling Load')
annotation('textbox',sprintf(name),'FitBoxToText','on');
end

 採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 16 日

1 投票

boxsize = [.2 .2 .8 .1]; %for example
annotation('textbox', boxsize, 'String', name, 'FitBoxToText','on');

その他の回答 (0 件)

カテゴリ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by