필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Function definitions are not permitted in this context.

조회 수: 3 (최근 30일)
Praveen  kumar
Praveen kumar 2016년 3월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
% minutiae function consists logic to check bifurcation and termination points function y=minutie(x) i=ceil(size(x/2)); if x(i,i)==0; y=0; else y=sum(x(:))-1; end

답변 (1개)

Jan
Jan 2016년 3월 11일
Functions can be defined in "function files" only: Files which start with the expression "function". There you can define a main function (called as the file), sub-functions, which are visible for the main-function also, and nested functions, which are visible for the parent function.
You cannot define functions inside scripts (M-files which donot start with "function") or in the command line.
Note: This topic has been discussed repeatedly and searchuing in the forum or the internet for the error message would reveal a solution very fast.
  댓글 수: 2
Praveen  kumar
Praveen kumar 2016년 3월 11일
i didn't understand
Ced
Ced 2016년 3월 11일
편집: Ced 2016년 3월 11일
The short answer is: You cannot define a function inside an normal script.
Googling for it will give you lots of detailed answers.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by