以下功能有什么问题?
function draw_multiple_images(image_list)
d = size(image_list);
l = length(d);
figure;
hold all
N = d(3) ;
[m, n] = factor_out(N);
for k=1:N
I = image_list(:,:,k);
size(I)
h = subplot(m,n,k);
image(I,'Parent',h);
set(gca,'xtick',[],'ytick',[])
end
hold off
end
错误消息
Error using image
Invalid datatype for Image CData. Numeric or logical matrix required for image CData.
Error in draw_multiple_images (line 11)
image(I,'Parent',h);
Error in draw_multiple_images_test (line 17)
draw_multiple_images(bp_filter_out_image);
答案 0 :(得分:0)
我解决了这个问题。
我使用imshow
代替image
。
N = d(3) ;
[m, n] = factor_out(N);
for k=1:N
I = image_list(:,:,k);
subplot(m,n,k);
imshow(I);
set(gca,'xtick',[],'ytick',[])
end