Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how import a variable from script file to function file?
Replies: 3   Last Post: May 15, 2013 12:31 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 116
Registered: 4/13/13
Re: how import a variable from script file to function file?
Posted: May 15, 2013 8:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 = 1-w(i)^2;
k2 = k1*sqrt(er);
g1 = er*sqrt(kz^2-k3^2).*besseli(1,sqrt(-kz^2-k2^2)).*besselk(0,sqrt(-kz^2-k3^2))+... sqrt(-kz^2-k2^2).*besseli(0,sqrt(-kz^2-k2^2)).*besselk(1,sqrt(-kz^2-k3^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?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.