pre allocating triple loops

조회 수: 2 (최근 30일)
Oday Shahadh
Oday Shahadh 2020년 6월 10일
답변: Stephen23 2020년 6월 11일
hi,
how to pre-allocate this:
for ii = 1:numel(L);
for jj=1:numel(L);
for kk=1:45;
c=cross(L1(ii,:),a{jj}(kk,:));
end
end
end

채택된 답변

Stephen23
Stephen23 2020년 6월 11일
n = numel(L);
c = cell(n,n,45);
for ii = 1:n
for jj = 1:n
for kk = 1:45
c{ii,jj,kk} = cross(L1(ii,:),a{jj}(kk,:));
end
end
end

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by