For Programmers: Free Programming Magazines  


Home > Archive > Matlab > August 2005 > Calling Subfunctions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Calling Subfunctions
Jeremy Smith

2005-08-31, 7:01 pm

How can I call a subfunction directly from the Matlab command window?
Lexinho

2005-08-31, 7:01 pm


"Jeremy Smith" <smit1729@umn.NOSPAM.edu> escreveu na mensagem
news:ef129ee.-1@webx.raydaftYaTP...
> How can I call a subfunction directly from the Matlab command window?


Look the way how GUIDE does it! The GUI builder checks the input arguments
and parses them to a subfunction callback. Like this:

function varargout = main_function(varargin)
varargout = feval(varargin{:});
return;

function argout1 = sub_function(argin1)
...
return;

then call:
something = main_function('sub_function', someotherthing);


lex


per isakson

2005-08-31, 7:01 pm

Jeremy Smith wrote:
>
>
> How can I call a subfunction directly from the Matlab command
> window?


It is only possible by means function handles (see documentation). /
per
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com