Expand vector into 3-D matrix

4 ビュー (過去 30 日間)
Brian DeCicco
Brian DeCicco 2021 年 7 月 1 日
編集済み: Matt J 2021 年 7 月 1 日
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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by