From: Anthony Hopf on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hsk7np$hf1$1(a)fred.mathworks.com>...
> Dear Anthony!
>
> > > TempA = A(IND(isfinite(IND))
>
> > This makes my find function look complicated but does the thing.
>
> Complicated?!
> Let me remember Matt Fig's:
> regexprep(A,'([^/]+/)(?!/)','${strrep($1,$1,'''')}')
> And Jason Breslau's equivalent:
> regexprep(A,{'.*[^/]/(?!/)', '\s'},{'', '_'})
> And Nathan's:
> cellfun(@(x)strrep(x(max(regexp(x,'[^/]/[^/]'))+2:end),'','_'),A,'uni',false)
> (all from the same thread here).
>
> Have a nice day, Jan

Haha, wow. touche. What does all of that do?

T
From: Jan Simon on
Dear Anthony!

> > regexprep(A,'([^/]+/)(?!/)','${strrep($1,$1,'''')}')
> > regexprep(A,{'.*[^/]/(?!/)', '\s'},{'', '_'})
> > cellfun(@(x)strrep(x(max(regexp(x,'[^/]/[^/]'))+2:end),'','_'),A,'uni',false)
>
> Haha, wow. touche. What does all of that do?

http://www.mathworks.com/matlabcentral/newsreader/view_thread/270630

Jan