compile script to create program

1 回表示 (過去 30 日間)
Anne
Anne 2017 年 4 月 10 日
コメント済み: Anne 2017 年 4 月 11 日
Hi
I've made made a script that is able to sort my "list2.csv" and then put it into a table. This list2.csv was only the test list. Now i need to change my script so it is possible to use it as a function on any list(with same amount of columns) that is put into it. can You guys please help me.
THX!!
  7 件のコメント
Adam
Adam 2017 年 4 月 10 日
Don't change the second line, put that (though again, use a sensible name) as the first line and remove the current first line. The function signature has to be the first thing in the file.
Anne
Anne 2017 年 4 月 11 日
now i've tried to write
function Listfunc(filename)
And then I called it like
Listfunc('C:\Users\PET-Center\Documents\MATLAB\KFList.csv')
I've godt the same error message again

サインインしてコメントする。

回答 (1 件)

Stephen23
Stephen23 2017 年 4 月 10 日
編集済み: Stephen23 2017 年 4 月 10 日
function myfun(filename)
%
delimiter = ',';
startRow = 2;
... the rest of your code.
end
And then call it using:
myfun( 'C:\Users\PET-Center\Documents\MATLAB\KFList.csv' )

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by