絶対パスから相対パスへ変更

MATLABで実行するときに現在は絶対パスを使用しています.ただほかの人に送ったときに実行ができないため相対パスに変更する方法はありますでしょうか。

2 comentarios

Kaede
Kaede el 2 de Jul. de 2020
Mushra('C:\Users\Inoguchi\Music\mashram1\example_config.txt')
このような絶対パスで現在実行しています.
Kaede
Kaede el 2 de Jul. de 2020
Mushra('..\mashram1\example_config.txt')
こちらで上手くいきました

Iniciar sesión para comentar.

 Respuesta aceptada

Shojiro SHIBAYAMA
Shojiro SHIBAYAMA el 13 de Jul. de 2020

0 votos

作業フォルダを起点に相対パスを書くならば
[pwd '/relative/path/data.mat']
pwd コマンドを使うと良いと思います。
mfilenameという関数も場合によっては利用可能です。

Más respuestas (0)

Categorías

Productos

Preguntada:

el 2 de Jul. de 2020

Respondida:

el 13 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!