Info
此问题已关闭。 请重新打开它进行编辑或回答。
concatenate a vector in column-major order
1 次查看(过去 30 天)
显示 更早的评论
I am trying to solve a problem where the elements of a vector is compared to something and if found true the location of the element (say(1,2)) is output into another vector in a column-major order . my problem is that the vector returns the location of the last element, it overrides the elements before it instead of concatenating it. e,g if the locations of the elements are (1,2) (3,2) (4,1). it returns only (4,1). how do I make it to concatenate and how do I set it to column-major order?
1 个评论
Azzi Abdelmalek
2016-6-2
Your question is not clear, post your code, you can also, illustrate with an example
回答(2 个)
Jos (10584)
2016-6-2
X = randi(20,6,4)
[ii,jj] = ndgrid(1:size(X,1), 1:size(X,2))
tf = X < ii.*jj
ii(tf)
jj(tf)
5 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!