User Tools

Site Tools


obj.filenameondisk
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


obj.filenameondisk [2011/04/02 23:52] (current) – created jochen
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**!
  
obj.filenameondisk.txt · Last modified: 2011/04/02 23:52 by jochen