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'.

 채택된 답변

KSSV
KSSV 2017년 3월 15일

1 개 추천

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)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2017년 3월 15일

댓글:

2017년 3월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by