Filter löschen
Filter löschen

create a variable with multiple time steps

3 Ansichten (letzte 30 Tage)
Hussein Kokash
Hussein Kokash am 17 Jan. 2023
Kommentiert: KSSV am 17 Jan. 2023
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!

Akzeptierte Antwort

KSSV
KSSV am 17 Jan. 2023
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 Kommentare
Hussein Kokash
Hussein Kokash am 17 Jan. 2023
Thank you for your reply KSSV.
What about ny in Z = zeros(nx*nx,nt)?
KSSV
KSSV am 17 Jan. 2023
ny == nx right? (x,y) wil be of same size.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by