Pointing to functions and files outside of the current matlab folder

조회 수: 12 (최근 30일)
Nikolay Rodionov
Nikolay Rodionov 2012년 5월 26일
Hi,
I was wondering, is a way to point to specific folders that might contain functions or input data files that are outside of the current matlab working folder?
For example lets say I am working with a program in the folder C:/matlab/main
can I make matlab run a function within that same program if the function is located in some other folder such as in C:/matlab/main/functions ?
Thank you, Nikolay Rodionov

답변 (2개)

Walter Roberson
Walter Roberson 2012년 5월 26일
You can add the other folder to your MATLAB path. Invoke pathtool if you want a graphic interface to set the MATLAB path.

Robert
Robert 2012년 5월 26일
It depends of the function that you are trying to import (you might need a different command like 'run' instead of 'importdata' here) but basically you run it normally and you give it the path:
D=importdata('C:/matlab/main/functions/D.dat')
I hope it helps,
Robert.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by