I have output (stored in variable "x") that I want saved into a simple text file. If I use the command:(adsbygoogle = window.adsbygoogle || []).push({});

fprintf('%d\n',x);

it prints the data in a nice column. This is what I want. Then to save it to a file I try this:

fileID = fopen('x.txt');

fprintf('%d\n',x);

fclose(fileID);

however Matlab does not like this. When I searched the help file, it gave a similar example, so what am I doing wrong here? Thanks in advance!

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# (quick) Matlab fprintf question

Loading...

Similar Threads for quick Matlab fprintf | Date |
---|---|

Quick Matlab Query | Feb 21, 2014 |

How to Become MATLAB Expert Quickly | Jan 9, 2012 |

A quick question regarding matlab | Oct 3, 2011 |

Matlab quick question | Dec 1, 2009 |

Quick matlab question | Jun 2, 2008 |

**Physics Forums - The Fusion of Science and Community**