필터 지우기
필터 지우기

variable being saved as nonsence

조회 수: 2 (최근 30일)
David
David 2014년 11월 24일
댓글: Orion 2014년 11월 24일
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.

채택된 답변

Orion
Orion 2014년 11월 24일
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
David
David 2014년 11월 24일
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 2014년 11월 24일
Good,
I was running out of idea :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by