variable being saved as nonsence

2 views (last 30 days)
David
David on 24 Nov 2014
Commented: Orion on 24 Nov 2014
Hi,
So in the past, when Ive had to save variables from the workspace in the past I've had no issues. However I am currently trying to save a variable (of a matrix containing numbers) as a .txt and for some reason I'm having a wierd issue.
In the command window I use
cd(...)
save('test.txt','testmatrix','-ascii')
Whichin the past has worked fine for me, however with this matrix it is giving me complete nonsence, and is just outputting a .txt full of stuff like
†㈠㜮〶〰〰ⵥ㐰
I have literally zero ideas as to what is causing this, yet a few may be it is quite a large matrix (50x400), mostly containing double precision variables. A a few cells contain a 0 value. Any of these may cause an issue? If not what could it be?
Cheers.

Accepted Answer

Orion
Orion on 24 Nov 2014
Did you change of Matlab version ?
I just did it with R2014a
testmatrix = rand(50,400);
save('test.txt','testmatrix','-ascii')
and i got a text file such as
7.9333239e-03 7.2173747e-01 5.0775133e-01 7.7271278e-01 1.4579592e-01 7.6052624e-01 1.7149844e-02 1.2863135e-01 3.1398573e-01 7.4287948e-01 1.9866456e-01 6.9662297e-01 3.8364462e-01 6.5203224e-02 6.7058812e-01 4.6045824e-01 4.0180554e-01 3.5262205e-01 5.6614612e-01 7.7905297e-01 7.5873115e-01 7.7782343e-01 7.5305231e-01 5.0488754e-01 8.4238319e-01 2.8728398e-01 9.5399787e-02 6.4921268e-01 2.4375847e-01 8.7876870e-01
...
this works just fine .
  5 Comments
David
David on 24 Nov 2014
Ah ha, fixed it; sorry for taking you your time mate. Asked IT at where I work and it turns out there was a messup with the software I was using. The code works fine. Sorry/thanks again!
Orion
Orion on 24 Nov 2014
Good,
I was running out of idea :)

Sign in to comment.

More Answers (0)

Categories

Find more on Variables in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!