필터 지우기
필터 지우기

Creating a 4-D array

조회 수: 3 (최근 30일)
Anantha Padmanabhan
Anantha Padmanabhan 2017년 6월 20일
편집: Stephen23 2017년 6월 20일
Hello everyone, I have been having trouble understanding the syntax behind creating 4-D matrices and I was hoping someone can answer my query.
I need to create a 4D matrix from my matlab data so I can use it as an input to another software which uses only 4D inputs. The matrix looks like this,
4-d_matrix=[time; 3-component_velocity; x_grid; y_grid]
Where time is of the size (1,n) 3-component velocity is of the size (l*b,3) and x_grid and y_grid correspond to the grid size which is l and b for x and y (l=b).
  댓글 수: 1
Stephen23
Stephen23 2017년 6월 20일
편집: Stephen23 2017년 6월 20일
4-d_matrix=[time; 3-component_velocity; x_grid; y_grid]
That syntax does not create a 4D array, and there is not reason to believe that it would. That syntax creates a 2D matrix, as the documentation clearly explains:
To create a 4D array you will need to use indexing, reshape, permute, or something of that ilk.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by