0

I've got a Matrix, let's say x, that contains seven values in exponential notation. Next i want to write this Variable to a textfuile, but without the exponential but with a decimal notation.

I tried str2num(num2str(exportdata, '%15.4f')); and fprintf but this only works for displayed data but not for storage as far as I know.

msp
  • 3,272
  • 7
  • 37
  • 49
Marcel Der
  • 171
  • 1
  • 4

1 Answers1

0

You can use fprinf to print directly to the file. For example:

v = [173524132746354.21542, 987678898521232.32547]

fid = fopen('file.txt','w')
fprintf(fid, '%0.2f, %0.2f', v)
fclose(fid)
jgrant
  • 1,273
  • 1
  • 14
  • 22