Write changing string format into txt file

Hey! I would like to write into a txt file, the location of my working directory.
I tried the function fprintf (or sprintf) but the problem is that I can't define a fixed format (with strings backlslash and integers) when I am using fprintf (or sprintf) because the format is changing when the working directory is changing!
Thanks for the help.

댓글 수: 5

Adam
Adam 2014년 9월 8일
편집: Adam 2014년 9월 8일
Isn't the working directory always just a basic string that you can put together using the [ ] notation if required? Then you can just write it to file as a string without needing any changing formatting style.
Guillaume
Guillaume 2014년 9월 8일
Can you give an example of what data you want to save, and how you want it saved?
Angelina
Angelina 2014년 9월 8일
How do I put my working directory into a basic string using []?
Angelina
Angelina 2014년 9월 8일
*working directory string
Angelina
Angelina 2014년 9월 8일
Hey Guillaume, I would like to save a full file path into a txt file. For example: C:\Documents and Settings\MyName\My Documents\Downloads
Cheers!

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

 채택된 답변

Angelina
Angelina 2014년 9월 8일

0 개 추천

Alright!
By simply using the function save it worked out.

추가 답변 (0개)

카테고리

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

질문:

2014년 9월 8일

답변:

2014년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by