Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add multiple channels to a 28x28x5000 matrix

I have an array of size 28x28x5000. I need to convert it to 28x28x3x5000. The third dimension represents channels. Each channel is the same copy.

How can I do this in Matlab without using a loop?

like image 469
Wajih Avatar asked Nov 27 '25 01:11

Wajih


1 Answers

Another one-liner is repmat(reshape(A,[28,28,1,5000]),1,1,3,1);

like image 70
khonegger Avatar answered Nov 29 '25 15:11

khonegger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!