Undefined function 'abs' for input arguments of type 'cell'.
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Daniel McCully
el 18 de Nov. de 2019
Comentada: Daniel McCully
el 20 de Nov. de 2019
function c = test(A)
r=abs(A(2,2));
disp(r);
end
I'm trying to take the absolute value of a specific cell but i get this error.
Undefined function 'abs' for input arguments of type 'cell'.
Error in test (line 2)
r=abs(A(2,2));
What is going on that I can't see?
A is also a matrix with dimensions of at least 2x2.
0 comentarios
Respuesta aceptada
Erivelton Gualter
el 18 de Nov. de 2019
It is saying A is a cell type. In order to check it, run the following code:
class(A)
If this is the case, the following should work:
function c = test(A)
r=abs([A{2,2}]);
disp(r);
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Digital Filtering 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!