Translating the map command and few others from Mathematica to MATLAB
问题 I did these so far: EDIT--------------- steps=@ (m) 2*randi([0,1],[1,m])-1; Walk1D =@ (n) [0,cumsum(steps(n))]; findend=@ (x) x(end); LastPoint1D=@(n) findend(Walk1D(n)); nsteps=200; nsq=floor(sqrt(nsteps)); MeanSquareDistance1D= @ (n,m) m.*sum((LastPoint1D(n)).^2)./m; r2D=MeanSquareDistance1D(100,1000) data=[ ]; for i=10:20:90 data=[data; i , MeanSquareDistance1D(i,2000)] end The only problem now,is that the 2nd column of "data" must give me values around 10 30 50 70 90 but not exactly.Only