how to delcare a 2 dimensional array in matlab?
조회 수: 41 (최근 30일)
이전 댓글 표시
heyy i am trying to declare an 2D array in c++ it was easy like: array[i][j]= value i want to assign but in matlab how is it possible? i want to store two values against one field...
댓글 수: 1
Jan
2011년 12월 28일
I've remove the "urgent" in the title and the tag. It does not increase the probability to get an answer. In contrary, it is counter-productive in this (ans other) forums.
What does this mean exactly: "I want to store two values against one field" ?
채택된 답변
Andrei Bobrov
2011년 12월 28일
array(i,j) = value;
댓글 수: 1
Matt Tearle
2011년 12월 28일
That. And if you want to preallocate space (which you should, if you have arrays that may grow significantly in loops):
array = zeros(m,n);
추가 답변 (2개)
Jan
2011년 12월 28일
This is a very basic question. This forum shall not be a replacement of reading the "Getting Started" chapters of the documentation.
If it is "urgent", it must be serious. If it is serious, there must be enough time to read the documentation.
댓글 수: 0
Walter Roberson
2011년 12월 28일
MATLAB does not have declarations, only assignments and references.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!