I'm new to Python and I would like to write a function that, given n inputs, returns m outputs. I can do this in Matlab, with a function like:
[a,b,c,d] = my_function(x,y,z,h)
where (x,y,z,h)
are multidimensional arrays.
In particular, having:
A=np.zeros((3,150,150))
B=np.zeros((3,150,150))
C=np.zeros((3,150,150))
D=np.zeros((3,150,150))
p=zero(3,1)
and given the for loop:
x.shape=(1540,1838)
step=10
jj=0
for j in range(0,1838,step):
jj=jj+1 #tot= 184
ii=0
for i in range(0,1540,step):
ii=ii+1 #total 154
pos=x(i,j)
executing now, within the for loop, my_function, I get the output:
a=A(:,ii,jj)
b=B(:,:,ii,jj)
c=C(:,:,ii,jj)
d=D(:,ii,jj)
Ho can I write the same function in Python style?