From: Anthony Hopf on 14 May 2010 15:46 "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 14 May 2010 16:45 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
First
|
Prev
|
Pages: 1 2 Prev: find/replace line of code (with carriage return) Next: make a new window in a GUI |