Filter löschen
Filter löschen

Expand vector into 3-D matrix

3 Ansichten (letzte 30 Tage)
Brian DeCicco
Brian DeCicco am 1 Jul. 2021
Bearbeitet: Matt J am 1 Jul. 2021
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!!

Akzeptierte Antwort

Matt J
Matt J am 1 Jul. 2021
Bearbeitet: Matt J am 1 Jul. 2021
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);

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by