Subscripted assignment dimension mismatch
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Manisha Jaiswal
am 14 Apr. 2018
Kommentiert: Manisha Jaiswal
am 15 Apr. 2018
N = 4;
tps=10;
status = [0 0 0 0 0 0 0 0 0 0 0];
img = zeros(540,960,N);
for i = 1:N
img_tmp = imread(f_list(i).name);
img(:,:,i) = img_tmp(:,:,1);
end
bck_img = (mean(img,3)); %average background template
%subplot(121);imagesc(bck_img)
%subplot(122);imagesc(img(:,:,1))
clear img;
pause(5)
%gaussian filter
hsize = 80;
sigma = 20;
gaus_filt = fspecial('gaussian',hsize , sigma);
%gaus_filt = fspecial('log',hsize , sigma);
%subplot(121); imagesc(gaus_filt)
%subplot(122); mesh(gaus_filt)
colormap(gray)
SE = strel('diamond', 0)
Here, I am getting the error as subscripted assignment dimension mismatch but I am unable to figure out where is the error.
3 Kommentare
per isakson
am 15 Apr. 2018
- Full error message, please!
- See Debug a MATLAB Program
- See Examine Values While Debugging
Akzeptierte Antwort
Walter Roberson
am 15 Apr. 2018
Your images are not all the same size when they are read in. You will need to read into a temporary variable and then either crop or pad or imresize() to fit the expected space.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!