I currently have:
val(:,:,1) =
0.7216
val(:,:,2) =
0.7216
val(:,:,3) =
0.7216
But I want
0.7216, 0.716, 0.721.
What sort of operation can I do to do that?
The reshape
function will do the trick here:
% Arrange the elements of val into a 1x3 array
val = reshape(val, [1 3]);
Because you are converting to a row-vector, the following syntax will also work:
val = val(:)';
Because val(:)
creates a column-vector, and the transpose operator '
then transposes that column-vector into a row-vector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With