matlab - How to use a cell array directly returned from a function? -


i have path (without file name @ end) string in matlab , want receive first parent directory (the directory after last file seperator character) in it.
@ moment i'm doing this:

>>filepath = 'd:\train_data\obstacles\dof'; >>firstparent = strsplit(filepath , filesep); >>firstparent = firstparent{end}; >>disp(firstparent); dof 


there way can use strsplit's return value (a cell array) without assinging variable first?
like:

>>filepath = 'd:\train_data\obstacles\dof'; >>firstparent = ( strsplit(filepath , filesep) ){end}; >>disp(firstparent); dof 

do mean:

[~,firstparent] = fileparts ( 'd:\train_data\obstacles\dof' ) 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -