translate matlab to igor

Hello,

I am trying to translate matlab to igor and I really need some one to help me out. Thanks in advance!!!

the matlab content is as below:
pin = zeros(numel(n), numel(theta));
taun = zeros(numel(n), numel(theta));
mu = cos(theta);
pin(1,:) = 1;
pin(2,:) = 3*mu;
taun(1,:) = mu;
taun(2,:) = 6*mu.^2 - 3;
for in=3:n(end)
pin(in,:) = (2*in - 1)/(in - 1)*mu.*pin(in-1,:) ...
- in/(in - 1).*pin(in-2,:);
taun(in,:) = in*mu.*pin(in,:) - (in + 1)*pin(in-1,:);
end

I have tried igor for the first few lines above but I'm not sure if it ok and how to do for the rest........
Make/O/N=(n,theta) pin
Make/O/N=(n,theta) taun
Make/O/N=(theta) mu= cos(theta)
pin(0,0)=1 //pin(1,:) = 1;
pin(1,0)=3*mu//pin(2,:) = 3*mu;
tau(0,0)=mu//taun(1,:) = mu;
tau(1,0)=6*mu^2-3





Please use the code and igor tags in your post. It makes it much more readable.

The expression
pin(1,:) = 1;
for example translates to
pin[0][] = 1

as Igor uses zero-based indizes. For an explanation see DisplayHelpTopic "Indexing and Subranges".

If new to Igor I'd spend some time studying
DisplayHelpTopic "Getting Started"

thomas_braun wrote:
Please use the code and igor tags in your post. It makes it much more readable.

The expression
pin(1,:) = 1;
for example translates to
pin[0][] = 1

as Igor uses zero-based indizes. For an explanation see DisplayHelpTopic "Indexing and Subranges".

If new to Igor I'd spend some time studying
DisplayHelpTopic "Getting Started"


Thank you very much. The topic is very helpful. but I think I use pin(0,0)=1, which is same as pin[0][]=1?



zhen wrote:
...
Thank you very much. The topic is very helpful. but I think I use pin(0,0)=1, which is same as pin[0][]=1?


As near as I can tell, pin(0,0) = 1 is either undefined or pin[0][0] = 1. The User Manual is a good thing to read at this point.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
jjweimer wrote:
zhen wrote:
...
Thank you very much. The topic is very helpful. but I think I use pin(0,0)=1, which is same as pin[0][]=1?


As near as I can tell, pin(0,0) = 1 is either undefined or pin[0][0] = 1. The User Manual is a good thing to read at this point.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville


Thank you very much, i see. if it is in function, I will use pin[0][] or x2pnt .