How can i decrease the execution time of a matrix classification?
이전 댓글 표시
I have a sparse matrix 34x2(or two column matrices of size 34).In the first column i have some double numbers and on the second column i have their id's(1-25), meaning that in both columns the non zero elements are in the same row. What i need is to create a sparse matrix 34x25 in order to classify the double numbers of the first column considering their id's.
At the moment i am using
temp1 = bsxfun(@eq,W(:,2),k);
IDClass = bsxfun(@times,temp1,W(:,1));
%where k is a vector with values 1:15
this procedure is quite costly so i need a faster way to do it but it still has to be vectorized. Any help?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!