MATLAB-使用字符串设置图形的标题

MATLAB-使用字符串设置图形的标题,matlab,Matlab,我正在写一个MATLAB程序,从用户那里读入一个标题,在一个图表上设置 t = input('Please enter a title for the graph: ', 's'); 然后我想将绘图标题设置为t。我似乎无法让它工作 title(t) %# returns ??? Index exceeds matrix dimensions. 非常感谢你的帮助 确保会话中没有名为title的变量屏蔽title()函数 » whos Name Size Bytes

我正在写一个MATLAB程序,从用户那里读入一个标题,在一个图表上设置

t = input('Please enter a title for the graph: ', 's');
然后我想将绘图标题设置为
t
。我似乎无法让它工作

title(t)    %# returns ??? Index exceeds matrix dimensions.

非常感谢你的帮助

确保会话中没有名为
title
的变量屏蔽
title()
函数

» whos
  Name       Size     Bytes  Class     Attributes

  t          1x1          2  char                
  title      1x1          8  double              <<<<---- you dont want this!
»谁
名称大小字节类属性
t1x12字符

标题1x1 8 double有没有一种方法可以在某个地方获得所有保留字的列表,比如这个?就这样,作为一个人应该避免什么的参考?我确实有这个。。。标题1x4 8字符如何消除此问题?非常感谢@Idigas:另一种检查名字
foo
是否已经用于内置函数的方法是,首先尝试
help foo
,看看它是否返回任何内容。@Idigas:如果你使用的是Matlab内置编辑器,关键字很容易被发现-它们是亮蓝色的:)@CuriousMe:看看这为什么会被否决,我无法理解+1.反击