function A=go_crazy(A)
if length(A) >1
for i=1:d
A(i,:,:,:,:)=i*go_crazy(A(i,:,:,:));
end
end
Problem is that I don't know in advance how many : to make. So my question is can i cut out an n-1 dimensional array without knowing n :)
Thanks alot
Something like this:
c(1:3)='{:}'
A(1,c{:})
Bruno
doesn't work. And I have no clue what it means at all
Ah sorry there is a typo it should be
A=rand(2,1,3);
clear c; c(1:ndims(A)-1)={':'};
A(1,c{:})
Bruno
res=1;
for k=1:numel(A)
res = res * A(k)
end
Thanks alot Bruno. You really helped me. I'm still puzzled over the syntax but it works :D