Can't figure out this debugging error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
liu James
el 16 de Dic. de 2016
Respondida: Stephen23
el 16 de Dic. de 2016
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
0 comentarios
Respuesta aceptada
Stephen23
el 16 de Dic. de 2016
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!