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 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_236389
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_236389
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_487763
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_487763
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_854858
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/154272-input-a-variable-into-a-plot-title#comment_854858
サインインしてコメントする。