compile script to create program

조회 수: 7 (최근 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 CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by