help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: M-file will only return one variable


From: Søren Hauberg
Subject: Re: M-file will only return one variable
Date: Wed, 10 Mar 2010 14:39:42 -0800

ons, 10 03 2010 kl. 16:51 -0500, skrev Jason Martin:
> 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.

How do you call the function? In your programs that use this function,
you should write something like

  [retrad, retang] = chebtran(ZL,Z0,Gm,NumSec);

and not

  retval = chebtran(ZL,Z0,Gm,NumSec);

This might be the cause of your problems.

Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]