I would like to use a specific return value from a function and pass it to another function, as a one-liner.
The problem is that I can't simply access the return value like someFunction(x, y, z){2} or [2] or (2), for example:
regexpi(str,'[a-z]+','match') % returns a cell array, i just need the first match.(btw, ^ doesn't work in matlab?)
if I would like to take the first child of the regexpi()
and pass it to myfun()
, what I want is:
myfun(regexpi(str,'[a-z]+','match')(1))
but I got an error instead:
Error: ()-indexing must appear last in an index expression.
Is there any workaround? thanks!