2010-02-20 18 views
6

我正在寫一個MATLAB程序從用戶的標題是對圖形設置的標題...MATLAB - 使用一個字符串來設置一個圖形

t = input('Please enter a title for the graph: ', 's'); 

然後我想設置我的陰謀的標題爲t。我似乎無法得到它的工作...

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

非常感謝您的幫助!

+1

這是爲什麼downvoted,我是無法理解...... +1反擊 – Rook

回答

8

確保在會話你有沒有變量稱爲title掩蓋title()功能

» whos 
    Name  Size  Bytes Class  Attributes 

    t   1x1   2 char     
    title  1x1   8 double    <<<<---- you dont want this! 
+0

有沒有辦法一個可以得到一個列表所有保留字,像這個,在哪裏?就這樣,作爲一個人應該避免的參考? – Rook

+0

我確實有這個... title 1x4 8 char 我該如何消除這種情況?非常感謝! – Mark

+0

重新啓動MATLAB取得了訣竅。非常感謝或幫助! – Mark

相關問題