在 Matlab 中从现有的 2d 矩阵创建 3d 矩阵 [英] Create 3d matrix from existing 2d matrix in Matlab

查看:28
本文介绍了在 Matlab 中从现有的 2d 矩阵创建 3d 矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个尺寸为 64 x 727 的 2D 矩阵.我想做的是将每一列分开,创建一个尺寸为 64 x 1 x 727 的 3D 矩阵.

I have a 2D matrix of dimensions 64 x 727. What I would like to do is separate each of the columns, creating a 3D matrix of dimensions 64 x 1 x 727.

我在这里浏览了几个类似的问题,但我有限的 matlab 能力使我无法将以前的答案应用于我自己的问题.

I have looked through several similar questions on here, but my limited matlab ability is preventing me from applying previous answers to my own issue.

非常感谢,

罗比

推荐答案

试试这个:

x2d = rand(64, 727);
x3d = reshape(x2d, 64, 1, 727);

这篇关于在 Matlab 中从现有的 2d 矩阵创建 3d 矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆