필터 지우기
필터 지우기

creating multi-line title with variable values

조회 수: 4 (최근 30일)
sermet
sermet 2016년 8월 8일
편집: Stephen23 2016년 8월 8일
doy=100; %double
igs=abcd; %string
title({'ERROR (m)';'doy:';'igs:'})
How can I write "doy" variable (100) and "igs" variable (abcd) right near the 'doy:' and 'igs:' on the title?

채택된 답변

Stephen23
Stephen23 2016년 8월 8일
편집: Stephen23 2016년 8월 8일
You can also make a multiline title by constructing a string with newline charcters. This is trivial to construct using sprintf and the arguments:
txt = sprintf('ERROR (m)\ndoy: %d\nigs: %s',doy,igs)
title(txt)
Or, if you really wish to use a cell array:
C = {'ERROR (m)',sprintf('doy: %d',doy),['igs: ',igs]};
title(C)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by