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!