How to split/reduce dimension of a variable

Hello,
I have a variable of size 40 x 40 x 2 x 102400 and i want to seperate this variable to two 40 x 40 x 102400 variables. I plan to use the data on python, but have problems with the size and dimensions of the data. I don't know if this is an easy or a complex problem but i am new to matlab and couldn't find how to do this.

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 31 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 31 日

1 投票

Lets var is the main variable-
var1=var(:,:,1,:);
var2=var(:,:,2,:);

4 件のコメント

Olca Orakci
Olca Orakci 2019 年 7 月 31 日
But this leaves me with a 40 x 40 x 1 x 102400 , how do i remove that 1.
should i use
squeeze(var1)
madhan ravi
madhan ravi 2019 年 7 月 31 日
Yes.
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 31 日
Thanks @Madhan
Olca Orakci
Olca Orakci 2019 年 7 月 31 日
Thank you both :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeClimate Science and Analysis についてさらに検索

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by