how to expand 2D array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
roudan
am 12 Mär. 2021
Kommentiert: Adam Danz
am 12 Mär. 2021
Hi
I create an array with shape of (2, 4), now I'd like to expand the array by 2 times in rows and 2 times in columns so the shape of array will become (4, 8). The values in the original small array will be only copied into a big every 2 rows and every 2 columns. NaN will be used for other locations. For example:
Original array, the values are:
1 2 3 4
5 6 7 8
The new array will be:
1 NaN 2 NaN 3 NaN 4 NaN
NaN NaN NaN NaN NaN NaN NaN NaN
5 NaN 6 NaN 7 NaN 8 NaN
NaN NaN NaN NaN NaN NaN NaN NaN
Then, I'd like to do interpolation to fill NaN in the big array.
Anyone has ideas? Thanks
1 Kommentar
David Hill
am 12 Mär. 2021
Your final matrix is 2x16 not 4x8. Show us the final matrix with the interpolation done that you want.
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!