plotting a figure with a variable as title
조회 수: 16 (최근 30일)
이전 댓글 표시
Hi, i want to plot a graph and the title of that graph should be equal to the variable mx1. how can i implement that?
댓글 수: 0
채택된 답변
Image Analyst
2014년 12월 25일
Try something like this
caption = sprintf('The result for this graph is %.3f', mx1);
title(caption, 'FontSize', 30);
댓글 수: 0
추가 답변 (1개)
Star Strider
2014년 12월 25일
Use sprintf:
mx1 = pi;
figure(1)
scatter(rand(10,1), rand(10,1))
grid
ttl = sprintf('Scatterplot For mx_1 = %.5f', mx1)
title(ttl)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!