Matlab Compiler Magic Numbers example won't work
6 次查看(过去 30 天)
显示 更早的评论
I have followed the magic number example in the documentation and for whatever reason it will not run at all. All it does is make the "windows ding" noise indicating something went wrong but doesn't give me an explanation.
Is there any additional steps to this example I should be making that aren't described in the text?
0 个评论
回答(3 个)
Titus Edelhofer
2013-1-30
Hi Ryan,
a good way to find out: start a windows command window (hit the windows start button, enter "cmd" as command. It should open the black console window.
cd to the folder where your .exe is.
Start the .exe "manually". Errors get displayed then in the cmd window. That should indicate whats wrong (or give you something that you can post so we have a chance to see what went wrong).
Titus
7 个评论
Titus Edelhofer
2013-2-19
If you need to pass arguments, you should do so, i.e.,
cd c:\PathToYourExecutable\
magicsquare 5
Where 5 is the parameter n.
Titus
Noah Frere
2016-8-3
Hello all. I am having a similar problem, but with MATLAB R2016a. I compiled magicsquares and ran it from terminal in Mac 10.11.4 El Capitan. Here's my command:
Noahs-MacBook-Pro:application noahfrere$ ./run_magicsquare.sh /Applications/MATLAB/MATLAB_Runtime/v901
and here's the result:
Setting up environment variables
---
DYLD_LIBRARY_PATH is .:/Applications/MATLAB/MATLAB_Runtime/v901/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v901/bin/maci64:/Applications/MATLAB/MATLAB_Runtime/v901/sys/os/maci64
Not enough input arguments.
Error in magicsquare (line 7)
MATLAB:minrhs
I did not enter the argument this time since I followed the prescription that worked for a different function:
function hello
disp('hello jill')
end
which worked just fine, using in Terminal:
Noahs-MacBook-Pro:for_redistribution_files_only noahfrere$ ./run_hello.sh /Applications/MATLAB/MATLAB_Runtime/v901
which output:
------------------------------------------
Setting up environment variables
---
DYLD_LIBRARY_PATH is .:/Applications/MATLAB/MATLAB_Runtime/v901/runtime/maci64:/Applications/MATLAB/MATLAB_Runtime/v901/bin/maci64:/Applications/MATLAB/MATLAB_Runtime/v901/sys/os/maci64
hello jill
When I tried running magic squares as recommended in the Mathworks tutorial:
Noahs-MacBook-Pro:application noahfrere$ ./magicsquare.app/Contents/MacOS/magicsquare 5
then the result is:
dyld: Library not loaded: @rpath/libmwlaunchermain.dylib
Referenced from: /Applications/magicsquare/application/./magicsquare.app/Contents/MacOS/magicsquare
Reason: image not found
Trace/BPT trap: 5
I tried a little coding following the readme.txt, which says: "If it is defined, set it to the concatenation of these strings:
${LD_LIBRARY_PATH}:
MCR_ROOT/v901/runtime/maci64:
MCR_ROOT/v901/sys/os/maci64:
MCR_ROOT/v901/bin/maci64"
changing the contents of the run_magicsquare.sh file so that it included "v901", which it did not include initially. However, I did not do that for the hello jill function. Either way, I couldn't get the magic squares executable to display the magic square.
Any ideas?
Also, the whole point of this is to eventually make a pretty complicated GUIDE gui executable. -or at least the functions that the gui contains. (that is, it doesn't have to be the gui if Matlab doesn't support that kind of activity). Basically, my code takes a bunch of data and takes the fft(data), the stft(data), graphs it, finds total energy, and finds percent error between the un-interpolated and the interpolated computations, and the frequencies at which the maximum values of the energy spectrum occur, for different sets of data. The idea is that when we get new data, we can analyze all of it with a single click on anyone's computer, rather than import it into Matlab, since not everyone will be using Matlab presumably.
Thanks for any help!
Noah
1 个评论
Jintao Chen
2016-11-17
编辑:Jintao Chen
2016-11-17
Hi Noah,
Hope you have solved your problem already. First thing first, there is no need to modify the output sh program.
For the issue of:
Not enough input arguments.
My answer may sound stupid, but you may want to check to see if you added below code at the beginning of your code out of practice, which I did.
clc; clear;
It removes the argument I just input. Remove it if you have it.
For the issue of
Reason: image not found
The command
./magicsquare.app/Contents/MacOS/magicsquare 5
you used doesn't make sense for me because - you first miss the space between used app and reference file - you are referring to only the library related with magicsquare but not other essential library for the standalone executable to run
Try this command instead and it may solve your issue
./run_magicsquare.sh /Applications/MATLAB/MATLAB_Runtime/v901 5'
Hope it helps.
Appreciate you sharing your questions here, it helped me to solve my issue.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!