Reputation: 65
I'm trying to convert some MATLAB code to python but I'm stuck on this for loop to fill out a matrix. Here is the MATLAB
for t=0:(Num-1)
for j= 1:2
ExpD(j,j) = exp(V(j,j)*t*Step)
end
Output(:,t+1) = V*expD
end
And here is my attempt at the python
for t in range(0,Num-1):
for j in range(1,2):
ExpD[j,j]=ma.exp(D[j,j[*t*Step)
Output[:,t+1] = V*expD
I'm getting an error saying there are too many indices for the array though. Thanks for the help.
Upvotes: 0
Views: 64