How can I introduce a ' \ ' after ' sprintf '
이전 댓글 표시
Hello
I have a problem introducing a slash after 'sprintf' function
My code is this:
folderName1='Image_%d_TrueColor_Segmentation';
mkdir('C:\Software\AUTOMATED RESULTS\Segmented_Images',sprintf(folderName1,Num_Exe));
ab=['C:\Software\Segmented_Images\',sprintf(folderName1,Num_Exe)];
My problem occurs as I am trying to introduce a '\' after the path of 'ab' variable. I tried to intriduce it in the 'folderName1' variable at the end but did not work.
Any ideas ???
Thank you in advance
채택된 답변
추가 답변 (2개)
Image Analyst
2012년 4월 29일
3 개 추천
Dimitris, for simplicity, just don't use backslashes. Did you know that forward slashes work just fine for Windows paths? But anyway, the solution is to use fullfile() like Jan said - it takes care of all that for you.
댓글 수: 1
Adri
2020년 6월 29일
I logged in just to like and comment this answer. Thank you very much!
Dimitris M
2012년 4월 29일
0 개 추천
댓글 수: 2
Jan
2012년 4월 29일
You are welcome. When reading the documentation does help, it helps faster than the forum. In addition the documentation of Matlab has a high quality. Therefore I suggest to read it whenever I can.
Daniel
2013년 11월 13일
On the other hand, forum answers are faster than the doc for the hundreds who will come after :)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!