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 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
% 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 Kommentare
KSSV
am 17 Mär. 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
am 17 Mär. 2017
And you overwrite scan on the next line so there is no reason to have the line anyhow.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Smoothing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!