MATRIX PROBLEM IN MATLAB
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Saptorshee Chakraborty
am 13 Jun. 2022
Kommentiert: Saptorshee Chakraborty
am 13 Jun. 2022
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 Kommentare
Akzeptierte Antwort
David Hill
am 13 Jun. 2022
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!