Help with saving to matlab

hey everyone, i am trying to save to matlab on my windows based computer but I get the error message (and warning) Warning: Invalid escape sequence appears in format string.
My code is attached (unfortunately this old comuter does not show the option to add nice code.)
i will not attach my function but here is me using it to call and save:
[code]
chooseEquation = 'poggiolini'; for att_db=0.19/1e3:0.01/1e3:0.20/1e3 %dirname =sprintf('C:\Documents and Settings\zceeg80\My Documents\MATLAB\simplifyCode %d',att_db);
[ResultsPogQPSK1 ] = MaxReachAnalytical(chooseEquation ,att_db);
fname= sprintf('C:\Documents and Settings\zceeg80\My Documents\MATLAB\simplifyCode\result.dat'); save(fname,ResultsPogQPSK1);
end [\code]
Anyone know what Im doing wrong? Thanks in advance!!

댓글 수: 3

Hey again, I found the problem. I had to put the second argument as a string. My code now looks like this:
chooseEquation = 'poggiolini';
for att_db=0.19/1e3:0.01/1e3:0.20/1e3 dirname =sprintf('C:\Documents and Settings\zceeg80\My Documents\MATLAB\simplifyCode %d',att_db); [ResultsPogQPSK1 ] = MaxReachAnalytical(chooseEquation ,att_db);
fname= sprintf(dirname,'\result.dat');
What I would like to know is how to load the data saved. I currently notice a result.dat and when I double click on it, it has three matrix (I only want to access the one called reach). How do I load this data followed by plotting it? Thanks in advance and also to the previous comment :)
TAB
TAB 2012년 6월 29일
load(fname);
u-will-neva-no
u-will-neva-no 2012년 6월 29일
Thanks. Im having a little trouble with my matlab code and will rephrase it in a new post later today. Thanks for everyones input!

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

 채택된 답변

TAB
TAB 2012년 6월 29일
편집: TAB 2012년 6월 29일

0 개 추천

Try
fname= sprintf('%s',...
'C:\Documents and Settings\zceeg80\My Documents\MATLAB\simplifyCode\result.dat')
See
>>doc sprintf

댓글 수: 3

Jan
Jan 2012년 6월 29일
Please, u-will-neva-no, add comments as comments, answers as answers and read the documentation of this forum about when to use flags.
u-will-neva-no
u-will-neva-no 2012년 6월 29일
Sorry, How do I unflag the above?
u-will-neva-no
u-will-neva-no 2012년 6월 29일
I think I have fixed that, sorry once again!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2012년 6월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by