The relation between Scouts and brain grid

Dear Steven
I tried to create leadfield matrix using your semi code and also several different ways but I couldn't :pensive:
I think it has a complicated solution. What do you think about it?
I really need to create leadfeild matrix in Matlab, could you please help me more?
I also checked @Francois comment several times, but I can not find the solution.

Best Regard
Morteza