Receiving writing-related error message while running a dmg app

조회 수: 1 (최근 30일)
Melanie VT
Melanie VT 2023년 2월 28일
댓글: Melanie VT 2023년 3월 7일
Hi,
I’m receiving the below error message while running a dmg app created via Application Compiler.
I’m using macOS Monterey (v12). I checked all Security & Privacy configurations and enabled every possible option. The interesting thing is that when I run the m file inside Matlab, it generates the outputs successfully. Any ideas on how to handle this issue?
Thanks in advance,
Mel
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 2월 28일
편집: Walter Roberson 2023년 2월 28일
I see this claim, but I do not know if it is accurate:
The instructions at https://www.techwalla.com/articles/how-to-edit-dmg are more along the lines of what I have read in the past.

댓글을 달려면 로그인하십시오.

채택된 답변

Melanie VT
Melanie VT 2023년 3월 7일
Thank you very much @Walter Roberson. It turns out that dmg files compiled by Application Compiler cannot write to relative file paths. Changing relative paths into absolute ones solved my problem!
E.g.
Changing this:
writetable(data, 'file.xlsx')
into this:
writetable(data, fullfile(path, 'file.xlsx'))
Cheers,
Mel
  댓글 수: 2
Walter Roberson
Walter Roberson 2023년 3월 7일
That would hint that your current directory is not what you expect
Melanie VT
Melanie VT 2023년 3월 7일
As a matter of fact, it is. Because as I mentioned in my first message, the same m.file (that the dmg application is compiled) generates outputs successfully through Matlab Command Window in the same computer. However, the permission is somehow not granted when the same request is sent from the dmg application.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by