Create 3D matrix from MULTIPLES 1xm matrix

By J dane

Is it possible to create 3D matrix from 1xm matrix? I would like to separate each column of the matrix into 3rd dimension. This is the related question. However, it doesn’t involve multiples of 1xm matrices, which I did.

a=randi([1 5], [1 100]);
b=randi([1 5], [1 100]);
c=randi([1 5], [1 100]);
d=randi([1 5], [1 100]);
%this is where I wanted to split the matrix when assembling
K=[b d a;
    b 0 a;
    b c a];

Resultant K matrix should be 3x3x100.
Thanks for any input!

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273