Indices of 'convolution' aka finding indicies of one matrix from a set of matrices in another matrix

3 ビュー (過去 30 日間)
Hi
I'm wondering if there is an efficient way to do the following.
Set up:
A=randi(2,10,3); B=(A(:,1)==1); C=A(B); indsOfC=myfun(C);
So C is a matrix whose rows are just those where A had a first column of 1, and inds is the result of doing some function with C as its argument. What I'm wondering is if there is an easy way of relating the indicies of C to the indices of A.
Thanks

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 9 月 9 日
Not very clear what you are asking. Using your example, if you run [I,J,V]=find(B), is the matrix I what you are looking for?

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by