필터 지우기
필터 지우기

How to draw MNIST images from pixel values

조회 수: 1 (최근 30일)
Muhammad Zohaib Jan
Muhammad Zohaib Jan 2019년 7월 29일
편집: Muhammad Zohaib Jan 2019년 7월 29일
I want to draw MNIST images from a 2 dimensional matrix. The matrix has 785 columns with last column containing the label. I want to draw randomly 20 images I used the following code:
figure;
perm = randperm(10000,20);
for i = 1:20
subplot(4,5,i);
image1 = train(perm(i), 1:end-1) / 255;
image1 = reshape(image1, [28 28 1 1]);
imshow(image1, [28 28]);
end
Where Train is the cell array containing all images its of dimension 60000 by 785
This shows garbage. I have tried image/imagesc and some other functions as well. Even tried using transpose but still doesnt work.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by