필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to use "For" cycles for ranges of 2D arrays

조회 수: 1 (최근 30일)
Hugo
Hugo 2022년 2월 25일
마감: Rik 2022년 2월 25일
Hello,
I have the following code:
D11=A1(1:1000,:)
D12=A1(1:2000,:)
D13=A1(1:3000,:)
D14=A1(1:4000,:)
D21=B1(1:1000,:)
D22=B1(1:2000,:)
D23=B1(1:3000,:)
D24=B1(1:4000,:)
D31=C1(1:1000,:)
D32=C1(1:2000,:)
D33=C1(1:3000,:)
D34=C1(1:4000,:)
I would like to fill new variables with a certain range of other 2D arrays. I know it's much better to use a "For" cycle, but I don't know how to do it properly with ranges. I kindly ask your help.
I thank you in advance,
Best regards,
  댓글 수: 1
Jan
Jan 2022년 2월 25일
It is not clear to me, what the inputs are and what you want to solve with the loop.
But hiding indices in thenames of variables is a shot in your knee. Use D{1,1}, D{1,2}, ... instead. The same for A1,B1,C1. As soon as you use arrays and indices, it is easy to call this inside loops.

답변 (0개)

이 질문은 마감되었습니다.

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by