필터 지우기
필터 지우기

Can't figure out this debugging error

조회 수: 1 (최근 30일)
liu James
liu James 2016년 12월 16일
답변: Stephen23 2016년 12월 16일
I'm getting this error:
Error: File: strategy.m Line: 146 Column: 4
The function "nonEmptyNum2Cell" was closed with an 'end', but at least one other function
definition was not. To avoid confusion when using nested functions, it is illegal to use both
conventions in the same file.
for this section of coding:
function Y = nonEmptyNum2Cell(X)
% Data conversion (matrix to cell array)
%%Data conversion (number to cell array)
% If X is not empty, then convert from number to cell array
if isempty(X) == false
Y = num2cell(X);
else
Y = X;
end
end
I'm not sure why I'm getting this error since it looks like they are all closed on my end.
Help

채택된 답변

Stephen23
Stephen23 2016년 12월 16일
Read the error message again. It tells you clearly that either all functions in the file need to use end, or none of them. You cannot combine these and have some of your functions with end and others without end.
Check your entire file and you will find that some functions do not use end.
My advice would be to use end for all functions.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by