how to delcare a 2 dimensional array in matlab?
141 次查看(过去 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 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!