필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Trouble Compiling Code Dependent on Folder Locations

조회 수: 1 (최근 30일)
Kevin
Kevin 2014년 7월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
My script requires the user to place input text files in a specific directory. This directory is pre-made, and is referenced by name and location relative to the script's location. This specific directory is not maintained during compilation. How can I get around this?

답변 (1개)

Image Analyst
Image Analyst 2014년 7월 22일
Don't make it relative to the compiled executable's folder. Just hard code the exact folder location (the "pre-made directory") into your code. I mean, you know exactly what it is, so why not?
  댓글 수: 2
Kevin
Kevin 2014년 7월 22일
Thanks for the response. But the purpose of compilation is for deployment, no? I wouldn't be able to distribute the compiled program this way.
Joseph Cheng
Joseph Cheng 2014년 7월 22일
편집: Joseph Cheng 2014년 7월 22일
Why not change the script to ask where these files are located? a simple uigetfile/uigetfolder implementation should negate any need for files to be in a specific location.
Secondly if you insist that it "*must* " be this way, you can use perform some necessary checks and use mkdir() to create the folder in an installation script file.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by