How translate script from matlab to use it in igor pro?

jarzyn
Posts: 11
Joined: 2010-02-17
Location: United Kingdom

Hi,
I'm completely new to Igor Pro I use to work with Matlab but once I used igor I love it.
My problem is probably trivial for most of you but not for me. My output from Monte Carlo sim is plotted in fig A
in matlab I use the following loop to get useful plot like in fig B

averagesviral=zeros(length(data2),1);
averagesviral(1)=data2(1);
for i=1:length(data1)-1;
averagesviral(i+1)=((averagesviral(i)*i+data2(i+1))/(i+1));
end

How to do similar operation in Igor Pro?
Thanks a lot.

plot A and B

Igor's picture
Posts: 194
Joined: 2007-06-29
Location: United States

I don't really know Matlab but this looks like:

Make/O /N=(numpnts(data2)) averagesviral=0
averagesviral[0]=data2[0]
averagesviral[1,]=(averagesviral[p-1]*(p-1)+data2[p])/(p)

A.G.
WaveMetrics, Inc.


jarzyn
Posts: 11
Joined: 2010-02-17
Location: United Kingdom

It is working. Thanks a lot.


Back to top