ghasem
Posts:
115
Registered:
4/13/13


Re: how import a variable from script file to function file?
Posted:
May 15, 2013 8:38 AM


is there anyone who help me? How import a "i" index from script to function? I need to import "i" index from script to function,where function include a two equation two variable. for example my function is as following: % function output = func_bedune_dielec(inputs) realPartOfInput = inputs(1); imagPartOfInput = inputs(2); % k1 , k2 , are known.and w is a vector that length(w)=100. % namely : w =linspace(1,5,100); kz = complex(realPartOfInput, imagPartOfInput); er = 1w(i)^2; k2 = k1*sqrt(er); g1 = er*sqrt(kz^2k3^2).*besseli(1,sqrt(kz^2k2^2)).*besselk(0,sqrt(kz^2k3^2))+... sqrt(kz^2k2^2).*besseli(0,sqrt(kz^2k2^2)).*besselk(1,sqrt(kz^2k3^2)); output = [ real(g1); imag(g1)];
% in fact,when function in FSOLVE is called,I want to use from w(i) in my function,so that "i" is for loop index of my script. how import "i" index value from script to function,when function is called? ghasem

