my code is neighbors = matrix3d(i-1:i+1, j-1:j+1, k-1:k+1);
It gives error like,
Undefined function or variable 'matrix3d'.

 Respuesta aceptada

KSSV
KSSV el 15 de Mzo. de 2017

1 voto

matrix3D is the variable 3D matrix you have. You have not defined it.
matrix3d = rand(10,10,10) ;
% say i = 1, j = 1
i = 2 ; j=3, k = 2
neighbors = matrix3d(i-1:i+1, j-1:j+1, k-1:k+1)

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de Mzo. de 2017

Comentada:

el 15 de Mzo. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by