variable being saved as nonsence
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
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
More Answers (0)
See Also
Categories
Find more on Whos 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!