create a variable with multiple time steps

Hello,
Is there a way to create a variable that contains data with multiple time steps?
I have x and y coordinates of a plane where x*y is the total coordinates number, correpsondingly each coordinate has a velocity value v, suppose I have 100 time steps, how can I create a variable that contains the whole values of velocity at all time steps (x*y*100)?
Thank you!

 採用された回答

KSSV
KSSV 2023 年 1 月 17 日

0 投票

LEt (x,y) be your data and t be your time.
nx = length(x) ;
nt = length(t) ;
Z = zeros(nx*nx,nt) ; % it is a 2D matrix; each column saves x*y elements

2 件のコメント

Hussein Kokash
Hussein Kokash 2023 年 1 月 17 日
Thank you for your reply KSSV.
What about ny in Z = zeros(nx*nx,nt)?
KSSV
KSSV 2023 年 1 月 17 日
ny == nx right? (x,y) wil be of same size.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

リリース

R2018b

タグ

質問済み:

2023 年 1 月 17 日

コメント済み:

2023 年 1 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by