create a variable with multiple time steps

조회 수: 7 (최근 30일)
Hussein Kokash
Hussein Kokash 2023년 1월 17일
댓글: KSSV 2023년 1월 17일
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일
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개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by