Custom Function error messages

조회 수: 6 (최근 30일)
Bob Matthews
Bob Matthews 2013년 3월 17일
Hi
I have the following custom function
function [OUT1,.....,OUT10]=dataSplit(origSet,testPoint,testDur,tap,trainVol,valVol)
where origSet is basic input (a spreadsheet 6 columns and several hundred rows) and the remainder of inputs are integers.
In the workspace I have the 6 inputs.
when I run dataSplit I get the following error message.................
Error using which (underlined)
Undefined function or variable 'origSet'.
Error in run (line 54)
[runDir,~,rext] = fileparts(which(script));
What do these error messages mean please?
Bob M

채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 17일
How are you starting up your dataSplit function? It appears that you might be using F5 or using Run from the menus. To run a function that takes input arguments, you need to go to the command line and enter the call there, giving the inputs on that line.

추가 답변 (1개)

Bob Matthews
Bob Matthews 2013년 3월 17일
Thanks, Walter and so I tried the following.........
run dataSplit (origSet, 645, 146, 4, 439, 146) Error using run Too many input arguments.
I suspect that I may be having trouble with origSet as the rest of the inputs are integers
Bob M
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 3월 17일
Leave out the word "run"
Bob Matthews
Bob Matthews 2013년 3월 20일
Thank you

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by