This shows you the differences between two versions of the page.
— |
obj.filenameondisk [2011/04/03 01:52] (current) jochen created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== obj.FilenameOnDisk ====== | ||
+ | |||
+ | ===== Motivation ===== | ||
+ | This method can be used in scripted applications, for instance to store a result of a call to another method (e.g. [[prt.CreateSDM|PRT::CreateSDM]]) under a similar filename (see example below). | ||
+ | |||
+ | ===== Reference ('obj.Help('FilenameOnDisk')') ===== | ||
+ | <file> AFT::FilenameOnDisk - returns the filename property | ||
+ | |||
+ | FORMAT: filename = obj.FilenameOnDisk; | ||
+ | |||
+ | No input fields | ||
+ | |||
+ | Output fields: | ||
+ | |||
+ | filename last used filename (on load or save) | ||
+ | |||
+ | TYPES: ALL</file> | ||
+ | |||
+ | ===== Usage example ===== | ||
+ | <code matlab obj_FilenameOnDisk_example.m>% loading a protocol | ||
+ | prt = xff('*.prt'); | ||
+ | |||
+ | % creating an SDM with | ||
+ | % - 240 volumes, | ||
+ | % - a TR of 2000 msec, and | ||
+ | % - no rest condition in the PRT | ||
+ | sdm = prt.CreateSDM(struct('nvol', 240, 'prtr', 2000, 'rcond', [])); | ||
+ | |||
+ | % save under same filename with .sdm extension | ||
+ | sdm.SaveAs(strrep(prt.FilenameOnDisk, '.prt', '.sdm'));</code> | ||
+ | |||
+ | ===== Usage notes ===== | ||
+ | The ''.FilenameOnDisk'' (property) method will return an **empty string for object that have not been load from/saved to disk**! | ||