Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Why do I get error when running a generated Function reaching a certain code where that certain code runs fine outside of the Function (R2011a)?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have generated a function which contains the following scripts:
f=-fnval(spline,[nodes.x(nodes.topnodes) nodes.y(nodes.topnodes)]');
when I run the function, I get an error saying that '' Input argument "x" is undefined'', where the same script without changing anything runs outside of the function.
The question is, if the scripts runs using the F9 key (or step by step) then why it doesn't run when running the whole function?
Do you have any idea why?
Thanks
댓글 수: 1
dpb
2013년 10월 21일
Need to see how the function is actually defined and called -- sounds like it's a case of turning a script into a function and not passing all the required inputs whereas the script uses existing variables in the workspace the function needs local copies which are only obtainable by being arguments in the function definition and then corresponding values passed when called.
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!