2013-10-19 21 views
1

我在Matlab中創建了我自己的函數,我希望能夠像下面那樣顯示它,當我鍵入'lookfor'時。在查找查詢中顯示Matlab函數摘要

>> lookfor mean 
mean       - Average or mean value. 
msfun_metronomean    - METRONOMANIMATION S-function for making metronomean animation. 
mameannorm      - normalizes microarray data by dividing by global mean. 
distfcm      - Distance measure in fuzzy c-mean clustering. 
fcm       - Data set clustering using fuzzy c-means clustering. 
initfcm      - Generate initial fuzzy partition matrix for fuzzy c-means clustering. 
stepfcm      - One step in fuzzy c-mean clustering. 

我聽說它可以直接下函數的聲明中鍵入行完成可以看到下面:

function [outputArgs] = TestFunction(inputArgs) 
%TESTFUNCTION Summary of this function goes here 

不過我試過這個,它仍然沒有按」 t出現在查找列表中?

任何幫助將不勝感激。

在此先感謝!

+1

您的搜索路徑功能是? 「哪些 - 所有的意思」返回?當我創建一個文件「mean.m」並將其添加到路徑中時,「lookfor mean」可以正常工作。 – StrongBad

回答

0

我不確定我改變了什麼,但它現在可以工作了。我相信這是與該項目存儲在文件路徑有關。感謝您的幫助,雖然傢伙。

0

目前尚不清楚你做了什麼。對於像

function [outputArgs] = TestFunction(inputArgs) 
%TESTFUNCTION Summary of this function goes here 

我不希望lookfor mean找到它。的lookfor文檔是很清楚

lookfor主題檢索在 搜索路徑中找到的所有MATLAB®程序文件的幫助文本的第一個註釋行 (H1的行)的字符串話題。對於發生匹配的所有文件,尋找 將顯示H1線。

尋找主題 - 全部搜索MATLAB 程序文件的整個第一個註釋塊尋找主題。

如果你想lookfor mean找到你的功能,你需要有H1線包括單詞「的意思是」

function [outputArgs] = TestFunction(inputArgs) 
%TESTFUNCTION Summary of this function goes here (mean) 

然後lookfor mean工作正常。

+0

函數[outputArgs] = TestFunction(inputArgs) %TESTFUNCTION此函數的摘要放在此處。這僅僅是一個在線例子,我沒有在我的問題中修改它,對於混淆抱歉。 – edwoollard

+0

我已更新我的問題以獲得滿意。 – edwoollard