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

How can I save matrix to .txt file?

Asked by Teemu on 13 Mar 2013

I have numerical matrix size of 64*60 and I like to save it to .txt file. How can I do it as easy as possible? without repeating %d with fprintf?

0 Comments

Teemu

Products

No products are associated with this question.

1 Answer

Answer by Friedrich on 13 Mar 2013
Edited by Friedrich on 13 Mar 2013
Accepted answer

Hi,

use dlmwrite

 a = rand(64,60);
 dlmwrite('filename.txt',a)

1 Comment

Teemu on 13 Mar 2013

Now it's working. Thanks!

Friedrich

Contact us