Variable in title is appearing as random string characters.
이전 댓글 표시
Running matlab R2019a
Im creating a mesh plot.
Here is my code for the title:
og_rows = 15360
og_cols = 1024
title(['Form Removed Data ',og_rows, 'x', og_cols])
This is following the matlab guidelines here: https://uk.mathworks.com/help/matlab/ref/title.html
This strangely results in this:

채택된 답변
추가 답변 (2개)
Walter Roberson
2019년 9월 4일
title( sprintf('Form Removed Data %d x %d',og_rows, og_cols) )
댓글 수: 1
Joe Pashley
2019년 9월 4일
편집: Joe Pashley
2019년 9월 4일
Steven Lord
2019년 9월 4일
Another option (instead of str2num or sprintf) is to use string operations.
og_rows = 15360;
og_cols = 1024;
title("Form Removed Data " + og_rows + " x " + og_cols)
댓글 수: 1
Walter Roberson
2019년 9월 4일
(The above solution requires R2017a or later.)
카테고리
도움말 센터 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!