The following code must be written in matlab
How to convert a 4d unit8 matrix of size
28 28 1 50000
in Matlab to a matrix of size 784*5000
Give an example that clearly solves this issue. Thanks
The problem here is either the first matrix has to be 28*28*1*5000 or the second matrix has to be 784*5000*10 because without these changes the sizes of the matrices are different.
So, I used two matrices to demonstrate the 2 cases.
a1 is of shape 28*28*1*5000
b1 is of shape 784*5000
a2 is of shape 28*28*1*50000
b2 is of shape 784*5000*10
CODE :
clear all; close all; clc;
a1 = ones(28,28,1,5000,'uint8');
b1 = reshape(a1,784,5000);
a2 = ones(28,28,1,50000,'uint8');
b2 = reshape(a2,784,5000,10);
Get Answers For Free
Most questions answered within 1 hours.