2016-08-12 65 views
-1

我寫了錯誤的情況下進入我的代碼,所以當參數計數字符串

if (condition 1) 
    error('Error \n(error message)',0) 

然而,MATLAB說

我「格式字符串可能無法與參數計數同意」不確定爲什麼我收到此消息,錯誤消息不包含參數計數。

+5

在提出問題之前,請先閱讀函數的文檔。這裏的錯誤是一樣的http://www.mathworks.com/help/matlab/ref/error.html#bumt6f4-4 – Nishant

回答

2

error表現爲sprintf

要麼使用

error('Error \n(error message)'); 

error('Error %d \n(error message)',0) 

即,您能介紹一些格式說明。