How can a put a variable into a text string
Show older comments
I want to put a variable onto a graph.
I have tried text(x,y,'Text ' num2str(variable) ' moretext') with no luck.
The only information I can find is how to put a variable in the title of a graph. I simply want it to be displayed at a location of my choosing on the graph.
1 Comment
Antonia Ciocoiu
on 6 Jul 2018
Edited: Antonia Ciocoiu
on 6 Jul 2018
a=(['Testing',num2str(2)]);
plot(x,y) %% plot your variables
xlabel(a)
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!