Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
fprintf to a directory of my choice??

Subject: fprintf to a directory of my choice??

From: Mateusz Gos

Date: 17 Nov, 2010 21:42:04

Message: 1 of 2

I am struggling to save my outputs via fprintf command, but not to my current working directory, but a different one (that does not have anything to do with Matlab) - say c:

it seems like something that should be doable and fairly simple, but so far I have not succeded. Can anyone advice me?

cheers

Subject: fprintf to a directory of my choice??

From: Walter Roberson

Date: 17 Nov, 2010 21:46:37

Message: 2 of 2

On 10-11-17 03:42 PM, Mateusz Gos wrote:
> I am struggling to save my outputs via fprintf command, but not to my
> current working directory, but a different one (that does not have
> anything to do with Matlab) - say c:
>
> it seems like something that should be doable and fairly simple, but so
> far I have not succeded. Can anyone advice me?

fprintf() has no control over directories. The fid (file identifier) that you
pass to fprintf() is associated with a file whose directory is set at the time
the file is opened using fopen().

For example,

fid = fopen('c:\temp\fizbin.txt', 'wt');

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us