I'm being told "Function definition not supported in this context. Create functions in code file."

조회 수: 6 (최근 30일)
I'm being told that the function in this code is not supported "in this context". What does this mean. It tells me to create functions in code file.
Now I'm modifying old code that Matlab accepted and ran, so this awfully weird.
I am attaching this file.

채택된 답변

DGM
DGM 2024년 8월 31일
Because this loop
%***************************************
%Matlab Runge Kutta Routine - NEED HELP
for count = 1:1:numsteps
is never closed with an end statement, all the local functions appear to be within the loop. I'm not sure where you want the loop scope to end, but you'll have to do that. Cleaning up your indentation and spacing will help make that more noticeable.
You also have two nested loops that both use the same loop index. Things like that may also cause problems later on.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by