필터 지우기
필터 지우기

tab completion with user defined function

조회 수: 10 (최근 30일)
Patrick Osborne
Patrick Osborne 2019년 12월 3일
댓글: Ken Atwell 2020년 8월 11일
I am trying to write a function that takes a .txt file as an input, however the text files have long numerical names therefore I would like to be able to autocomplete them with tab. I have created a json file which I think is correct however when I try to use the function in the command window and tab in any files it just says there are no completions found. I was wondering if anyone can spot what is going wrong?
%json file
{
"output_MT_data":
{
"inputs":
[
{"name":"filename", "kind":"required", "type":"file=*.txt"}
]
}
}
%function file
function output = output_MT_data(filename, counter_start, counter_end)
Table = readtable(filename);
if ~exist('counter_start', 'var')
counter_start = 1;
end
if ~exist('counter_end', 'var')
counter_end = height(Table);
end
output = Table(counter_start:counter_end, 1:4);
end
  댓글 수: 2
Rik
Rik 2019년 12월 3일
When I tried using functionSignatures, one of the suggestions was to restart Matlab to force a resfresh of the suggestions. Have you tried that?
Ken Atwell
Ken Atwell 2020년 8월 11일
The JSON file looks okay; where did you place this file in relation to the location of the function .m file?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 JSON Format에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by