你好 stackoverflow 社區,
我目前正在嘗試將 Matlab 應用程式創建為獨立應用程式。在 Matlab 中,程式通過 GUI 運行良好,但是,只要我在桌面上安裝應用程式并運行它,就會在命令視窗中輸出以下錯誤訊息:
- 使用 dicom_getFileDetails 時出錯(第 14 行)無法加載檔案“RE.#_STR_IMG.REGISTRATION.dcm”。
- dicominfo 中的錯誤(第 55 行)
- Apply_Registration/ApplyRegistrationButtonPushed 中的錯誤(第 64 行)
- appdesigner.internal.service.AppManagementService/tryCallback 中的錯誤(第 333 行)
- matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) 中的錯誤(第 35 行)
- 使用 matlab.ui.control.internal.controller.ComponentController/executeUserCallback 時出錯(第 335 行)評估按鈕 PrivateButtonPushedFcn 時出錯。
代碼:1 2)
% Button pushed function: OpenRegistrationFileButton
function OpenRegistrationFileButtonPushed(app, event)
% Open registration file
app.File_registrationFile = uigetfile;
end
-
reginfo = dicominfo(app.File_registrationFile);
作為獨立應用程式運行時有什么問題?
Matlab 運行時編譯器與我的 Matlab 版本相匹配。不幸的是,我缺乏在這里前進的專業知識。
任何幫助將不勝感激!
uj5u.com熱心網友回復:
您當前僅從uigetfile( docs ) 輸出檔案名,因此該檔案的后續使用假定它與正在執行的應用程式位于同一檔案夾中。這可能不是這種情況,因此檔案無法加載的錯誤(因為它不存在)。
您只需要更加明確,獲取路徑并參考完整的檔案路徑,而不僅僅是名稱
[file,path] = uigetfile;
app.File_registrationFile = fullfile( path, file );
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/481583.html
標籤:matlab 用户界面 matlab-部署 matlab编译器
上一篇:矩陣邏輯matlab
