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)
  
       Show older comments
    
% 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
      
      
 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.
  Walter Roberson
      
      
 on 17 Mar 2017
				And you overwrite scan on the next line so there is no reason to have the line anyhow.
Answers (0)
See Also
Categories
				Find more on Smoothing in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

