Rank: 4863 based on 16 downloads (last 30 days) and 2 files submitted
photo

Jared

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Jared View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
15 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared parse, input, parameter value pairs, inputparser 9 9
  • 4.5
4.5 | 2 ratings
15 Jan 2013 easydefaults Easy-to-use interface for supplying default values for function inputs. Author: Jared input, parameter value pairs, parse, default values, function arguments 7 0
Comments and Ratings by Jared View all
Updated File Comments Rating
22 Jan 2014 bsxops Force MATLAB operators to behave BSXFUN-like Author: Bruno Luong

An extremely useful set of functions.

08 Jan 2014 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared

Hi Alan, thanks for the response and for pointing me in the direction of the procArgs function--I wasn't aware of it when I crated easyparse and easydefaults.

I think both solutions are very simple (especially since both easyparse and procArgs can take a single argument), but I might suggest that requiring procArgs to only populate existing variables in the function might be somewhat limiting.

One of the largest uses I have for easyparse--or parameter-value pairs in general--is for optional arguments: only if the caller defines a variable is that variable defined in the function. Optional arguments would seem to be difficult to achieve with procArgs. One could create artificial empty variables, but this might begin to get a little unwieldy, in my opinion.

Thanks again for the feedback!

19 Jul 2013 Fractions Toolbox create and manipulate fractions (K+N/D) using exact arithmetic Author: Ben Petschel

Ben, very useful tool. I wanted to alert you to what looks to be a small bug:

In @fr/rat, I think line 54 should read:

varargout{1}=N+K.*D;

rather than

varargout{1}=N+K*D;

I am happy so far and will provide more feedback one I have more time to play with it.

14 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared

Hi Jurgen,

That seems very similar to what is done by standard function inputs. For instance, if you only send three parameters to:

function demo_function(a,b,c,d,e)

then only a,b,c will be defined, with d and e ignored. So unless I am misunderstanding, in the context of parsing inputs, I'm not sure what would be gained.

Or is there another, more general application for this functionality? If there's a compelling use case, what you're describing would be pretty easy to implement based on the code in easyparse.

11 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared

Hi Jurgen, glad you like it!

Can you explain your use case a bit more? As far as I understand, standard function inputs do something pretty similar to what you're describing, but perhaps I don't understand what you are looking for. Like you said, so does deal (also check Example 3 in deal, namely: [a,b,c,d] = C{:}).

Or, if perhaps you're trying to establish default arguments, you could try easydefaults, here:

mathworks.com/matlabcentral/fileexchange/39785-easydefaults

Comments and Ratings on Jared 's Files View all
Updated File Comment by Comments Rating
08 Jan 2014 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared Jared

Hi Alan, thanks for the response and for pointing me in the direction of the procArgs function--I wasn't aware of it when I crated easyparse and easydefaults.

I think both solutions are very simple (especially since both easyparse and procArgs can take a single argument), but I might suggest that requiring procArgs to only populate existing variables in the function might be somewhat limiting.

One of the largest uses I have for easyparse--or parameter-value pairs in general--is for optional arguments: only if the caller defines a variable is that variable defined in the function. Optional arguments would seem to be difficult to achieve with procArgs. One could create artificial empty variables, but this might begin to get a little unwieldy, in my opinion.

Thanks again for the feedback!

08 Jan 2014 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared Alan Robinson

Much easier than Matlab's inputparser. I do something similar with my procArgs function, except I get the list of allowed variables by requiring that they already be created in the calling function, which is arguably easier still.

14 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared Jurgen

Indeed, I was overthinking things again. easydefaults solved it, thanks :).

14 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared Jared

Hi Jurgen,

That seems very similar to what is done by standard function inputs. For instance, if you only send three parameters to:

function demo_function(a,b,c,d,e)

then only a,b,c will be defined, with d and e ignored. So unless I am misunderstanding, in the context of parsing inputs, I'm not sure what would be gained.

Or is there another, more general application for this functionality? If there's a compelling use case, what you're describing would be pretty easy to implement based on the code in easyparse.

12 Jan 2013 easyparse Easy-to-use interface for parsing function inputs in the form of parameter-value pairs. Author: Jared Jurgen

Yes very similar to example 3 from deal(). However with deal() the number of outputs on the left must equal the number of inputs (i.e. length(C)). So if I give 10 output and only 5 input it gives an error. But I would like the first 5 to be assigned and the last 5 to be ignored.

Contact us