index in position 2 exceeds array bounds (must not exceed 1)

1 view (last 30 days)
this is my code
Total_amount = 100000000;
senarios = 10000
years = 5
% Lower bin of the matrix
load("QFRM_Data (2).mat")
AEX_ = AEX(:,[6])
NASDAQ_= NASDAQ(:,[6])
Nikkei_= Nikkei(:,[6])
Treasury_= Treasury(:,[6])
EURJPY_= EURJPY(:,[6])
EURUSD_= EURUSD(:,[6])
n=1;
suma=0
for n=1:1:10000
Treasury_(1,n)
suma=Treasury_(1,n)+suma;
norminv=1-suma
n=n+1;
end
n=1;
suma=0
for n=1:1:10000
AEX_(1,n)
suma=AEX_(1,n)+suma;
norminv1=1-suma
n=n+1;
end
n=1;
suma=0
for n=1:1:10000
NASDAQ_(1,n)
suma=NASDAQ_(1,n)+suma;
norminv2=1-suma
n=n+1;
end
n=1;
suma=0
for n=1:1:1000
Nikkei_(1,n)
suma=Nikkei_(1,n)+suma;
norminv3=1-suma
n=n+1;
end
im stuck , i have no idea how to solve this, could someone enligten me ?
thanks in advance !
  10 Comments

Sign in to comment.

Answers (1)

Adam Danz
Adam Danz on 7 Apr 2021
Change Treasury_(1,n)
To Treasury_(n,1)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!