From: Markus Due Jakobsen on
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
"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
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