When I call a function with multiple returns, I have to call it as:
[var1, var2] = functionname(variables);
Ok, I see now.
Thanks James.
Jason
On 3/10/2010 5:01 PM, James Sherman Jr. wrote:
How are you calling the function? If you're calling it as
[retrad, retang] = chebtran(ZL,Z0,Gm,NumSec);
and you say that only one variable is returned, does that mean retang
is empty? As far as I can tell, there isn't anything wrong in the
syntax of your function.
James
On Wed, Mar 10, 2010 at 4:51 PM, Jason
Martin <address@hidden>
wrote:
Good
afternoon list,
I am working on a small set of m-files for my microwave circuits
class and I am trying to return one answer in two different formats. My
m-file is:
function [retrad, retang] = chebtran(ZL,Z0,Gm,NumSec)
pr0 = log(ZL/Z0);
pr1 = acosh((1/0.1)*(pr0));
pr2 = cosh((1/NumSec)*(pr1));
pr3 = asec(pr2);
pr4 = pr3*180/pi;
retrad = pr3;
retang = pr4;
endfunction
My issue is, only one variable is returned. In the current order,
I will get the radian answer, retrad, but not the angle answer, retang.
But if I put retang first, I will only get the angle and not the
radian. According to the manual this should be correct, but I cannot
figure out why I am not getting both answers to return properly.
Thanks in advance for any help.
Jason
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
|