|
From: Markus Due Jakobsen on 7 May 2008 06:44 Hi, If I have two variables ex. either Output='Output1.txt' og Output='Output2.txt' and i want one of the variables to be written in the dlmwrite-command as the filename: ex. dlmwrite('Output1.txt',OUTPUT) or dlmwrite('Output2.txt',OUTPUT) How is this possible? How is it possible to change the format to show the number 2119.8... instead of 2.1198e+003? Thanks, Markus
From: Tim Love on 7 May 2008 07:09 "Markus Due Jakobsen" <markusdue(a)gmail.com> writes: >Hi, >If I have two variables ex. either Output='Output1.txt' og >Output='Output2.txt' and i want one of the variables to be >written in the dlmwrite-command as the filename: ex. >dlmwrite('Output1.txt',OUTPUT) or >dlmwrite('Output2.txt',OUTPUT) >How is this possible? Try eval(sprintf('dlmwrite(''%s'',OUTPUT)',Output)); >How is it possible to change the format to show the number >2119.8... instead of 2.1198e+003? Try help format or help fprintf ?
From: Peter Boettcher on 7 May 2008 09:14 tpl(a)eng.cam.ac.uk (Tim Love) writes: > "Markus Due Jakobsen" <markusdue(a)gmail.com> writes: > >>Hi, > >>If I have two variables ex. either Output='Output1.txt' og >>Output='Output2.txt' and i want one of the variables to be >>written in the dlmwrite-command as the filename: ex. >>dlmwrite('Output1.txt',OUTPUT) or >>dlmwrite('Output2.txt',OUTPUT) >>How is this possible? > Try > eval(sprintf('dlmwrite(''%s'',OUTPUT)',Output)); Oof. That's equivalent to: dlmwrite(Output, OUTPUT); -Peter
|
Pages: 1 Prev: creating a P1D with the system identification toolbox Next: Add new elements to .mat file |