how to use a file from a different directory?

1 Ansicht (letzte 30 Tage)
rachida
rachida am 22 Jul. 2019
Kommentiert: rachida am 22 Jul. 2019
Hello,
i have developed a program and it works correctly ,and now i want to make it as a function so i need as input a directory(directoryname) and inside the function i want to get the file c.ini wich is in the directoryname
function B(directoryname) % the function B is why i am trying to program now
N = inifile(directoryname\c.ini,90) %infile is a one of my function wich needs as input the file c.ini
Thank you

Akzeptierte Antwort

Stephen23
Stephen23 am 22 Jul. 2019
Bearbeitet: Stephen23 am 22 Jul. 2019
Use fullfile to build the full filename:
function B(dirName)
N = inifile(fullfile(dirName,'c.ini'),90)
...
end
  1 Kommentar
rachida
rachida am 22 Jul. 2019
thank you a lot it works very good i got what i want

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Search Path finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by