MATRIX PROBLEM IN MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a simple question, why does regime (aa) is becoming 0 2
T=48;
B=3;
j = 1:B
bk = 2:(T-2)
regime = [0,bk,T-1]
aa = 1:(j+1)
regime(aa)
댓글 수: 0
채택된 답변
David Hill
2022년 6월 13일
You are indexing into regime with an array (aa) which is 1:2. Not sure what you want array (aa) to be:
j=1:3;
aa=1:(j+1);%this will only take the first element of j, same as aa=1:2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!