필터 지우기
필터 지우기

How to get 3 variables in the title

조회 수: 1 (최근 30일)
Chris
Chris 2013년 1월 20일
I'm trying to get the title to say 'Rocket(value), Chute1(value), Chute2(value)', where the values correspond to each one. Rocket, Chute1, and Chute2 are all inputs in my function.
This is what i've tried, but it wont work. I've seen Dougs tutorial on this, though this does not help me.
title('Rocket('(rocket) '),' 'Chute1('chute1 '),' 'Chute2('chute2 '))
Help please,
Thankyou.

채택된 답변

Image Analyst
Image Analyst 2013년 1월 20일
Use sprintf() to create a caption:
caption = sprintf('Rocket(%.3f), Chute1(%.3f), Chute2(%.3f)',...
Rocket, Chute1, Chute2);
title(caption, 'FontSize', 16);
You can use %d instead of %.3f if the values are integers rather than floating point. You can put a \n anywhere that you want to go to a new line.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Speech Recognition에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by