How to add a file location in Matlab

I am trying to run a code which requires a ".eps" file as input which is called "resource". The code convert the file into something else and save it in "destination".
function X(resource, destination)
Would you please let me know how I can enter these two variables via an example. Let's say the resource file is located in "C:\Test\res.eps" and I want to save it to "C:\Test\des"

 채택된 답변

Tom
Tom 2012년 2월 18일

0 개 추천

You can change the current directory (the folder Matlab is currently working in) using the cd function. e.g.
cd C:\Test\res.eps

댓글 수: 2

Marmar
Marmar 2012년 2월 18일
Thank you :) What if I want to use a file in another directory. I tried to run the code as
X('C:\Test\res.eps', 'C:\Test\des')
But didn't work out. It should have worked unless there is something in the code for function X which causes the problem; would you think the same?
Marmar
Marmar 2012년 2월 18일
Sorry! It actually worked ... Thanks ...

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

질문:

2012년 2월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by