Expand vector into 3-D matrix

2 次查看(过去 30 天)
Hello, I am trying to expand a 1x117 vector of values into a 3-D matrix of dimensions 1440x721x117. I would like the first first 2 dimensions to be longitude (1440x1) and latitude (720x1) values, and the 3rd dimension will be 117 time steps. Each time step is represented by its own unique value for each point globally. For example, the value at the first time step is -10.3685, so this value should be the same at every longtitude/latitude point. How would I write this...would I need to concatenate? Thanks!!

采纳的回答

Matt J
Matt J 2021-7-1
编辑:Matt J 2021-7-1
It seems like a waste of memory to make so many copies, but here is how it could be done:
result = repmat(reshape(vector,1,1,[]) ,1440 721);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by