Add String to Matlab Plot Annotation
24 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to add an annotation to a plot that uses a variable from the workspace. I have used the below code, but the only output I get is 'Pf Size:'
Can someone please assist with the syntax?
dim = [.2 .5 .3 .3];
str = ('Pf Size:' num2str(pfSize));
annotation('textbox',dim,'String',str,'FitBoxToText','on');
0 Commenti
Risposta accettata
Chunru
il 26 Lug 2021
pfSize = 2;
dim = [.2 .5 .3 .3];
str = ['Pf Size:' num2str(pfSize)]; % use [] instead of ()
plot(rand(10,1))
annotation('textbox',dim,'String',str,'FitBoxToText','on');
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!