Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Trouble Compiling Code Dependent on Folder Locations

1 Ansicht (letzte 30 Tage)
Kevin
Kevin am 22 Jul. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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?

Antworten (1)

Image Analyst
Image Analyst am 22 Jul. 2014
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 Kommentare
Kevin
Kevin am 22 Jul. 2014
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 am 22 Jul. 2014
Bearbeitet: Joseph Cheng am 22 Jul. 2014
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.

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by