I've trawled through these forums and found loads on inputting variables as titles, however, none of them work for me. Im trying to change the title of a plot with respect to a parameter the user will enter in the function. First i call a string for example
str = sprintf('just an example of %d that isnt working', variable)
title(str)
However only the 'just an example of' is printed out on the title of the plot, everything after and including the variable has dissapeared, this happens when i move the variable about in the title too.
Cheers!
3 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_236389
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_236389
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_487763
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_487763
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_854858
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_854858
Sign in to comment.