Create location Index from cell arrays
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a small piece of code that loops through an array and creates an Index location of that value in another cell array. According to the code profiler, this small little loop is taking up 75% of the time of my entire script. I have a smaller cell array (Mutual Fund Portfolio) called 'FundHlds'. What I do with this loop is find the location of each identifer from this array in my larger list, another cell array called 'UniqueList'. Once I create this Index, I can then compare everything in my current portfolio to the information contained in the UniqueList cell array via the Index. I'd like to get rid of this loop method because it's very slow, and the help documentation states that strmatch will be going away in the future. Does anyone know a better way to do this?
for t = 1:length(FundHlds)
bl(t,1) = strmatch(FundHlds(t),UniqueList);
end
Thanks a lot, Brian
댓글 수: 0
채택된 답변
추가 답변 (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!