views:

29

answers:

2

Hello if I wanted to do the opposite of what has been explained in this link:

http://stackoverflow.com/questions/3595485/other-problems-with-data-acquisition-from-matlab

I would pass by the vectors (eg. codeserv = [NNNNNNNNNN ....] area = [IIIIIII ....] [.........]) to create the text file with the same format as in the link, ie:

  • Comment line | Code | serv | etc. ...
  • Comment line Figures | Figures | Figures | etc. ......

We must rebuild a new drive or you can adapt the code?

Thanks for your help and information about it.

A: 

Instead of using textscan in order to scan some input, you may use fprintf for output.

zellus
+1  A: 

Here is a little sample, what should help you to save your first file out of Matlab onto your hard drive.

%some nr to integrate into the printf
num=2.0 
%opens the file: 'file_name' with write access 
f = fopen(file_name,'w');
%writes some text into the file
fprintf(f,'test-file dump\r\n');
%writes text and includes a fload number out of matlab workspace
fprintf(f,'some-float=%f \r\n', num);
%important closes the file, other wise no other program can grand write access on the file
fclose(f);

Hopefully it helps.

eactor
See also, `dlmwrite`, using a `|` delimiter.
Richie Cotton
thank you for your help. I'm trying to implmentare your suggestions
Marietto85

related questions