Subscript indices must either be real positive integers or logicals. The error starts when I am doing smoothing of the scan. However, I need positive and negative integer since its for brain scanning. Is there a method to solve this program?

2 views (last 30 days)
% PREPARATION OF DATA FOR CLUSTERING ANALYSIS
%Creating a copy of the original dataset
scan = X;
mn = var(scan,0,3);
imagesc(mn);
%STEP 1: Normalization
A = A*-1;
scan = scan+A;
[m n p] = size(scan);
% Median Filter
for p = 1:180,
I = X(:,:,p);
smooth(:,:,p) = medfilt2(I,[m n]);
end
scan =smooth(I);
scan = reshape(smooth,m*n,p);
  2 Comments
KSSV
KSSV on 17 Mar 2017
Without knowing data, and the error line it would be tough to help you. I suspect you got error here scan =smooth(I); You are sending matrix I inside smooth, I doesn't have all positive integers, so error popped.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!