필터 지우기
필터 지우기

multi-level indexing

조회 수: 3 (최근 30일)
Jonathan Roy
Jonathan Roy 2012년 6월 6일
Hi! I have this structure "result.pops(1:1000,1:20).obj(1:2)"
I want to make addition of 2 value (obj(1) + obj(2)), of all pops file. I expect a matrix size 1000x20 where each case are sum of obj 1 and 2... I get this error " Scalar index req. for this type of multi-level indexing"
I usualy use "For" loop to execute the job but I want to learn the good way to make it faster
Thank you for your suggestion!

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 6일
struct2cell(), cell2mat(), sum() on the appropriate dimension.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by