How can i edit my code which works on r2014b version at work but not on my personal r2024a version?
Mostrar comentarios más antiguos
I have an IAD code, number of lines long. It works great on the MATLAB r2014b version but on my r2024a version at home, i get an error of the following:
Running IAD on dataset 1
zsh:1: command not found: iad
Sample1_IAD.txt
Error using movefile
No matching files named 'XXXXXX' were found.
Error in IAD_Analyzer_WCV_04_11_23 (line 239)
movefile(iad_output_file,strcat([pwd, '\results']))
Please can someone well versed in MATLAB suggest what I should change in the code to address this error in the r2024a version? It seems to be a matter of changing file location or using a different cmd from 'movefile' etc but I've tried all I know to do with no success. Thank you, I appreciate any help.
2 comentarios
Walter Roberson
el 19 de Jul. de 2024
movefile(iad_output_file,strcat([pwd, '\results']))
You should be using fullfile() instead
movefile(iad_output_file,fullfile(pwd, 'results'))
Oluwadamilola Oke
el 22 de Jul. de 2024
Respuestas (1)
Fangjun Jiang
el 19 de Jul. de 2024
0 votos
No matching files named 'XXXXXX' were found.
This is the error. It should give you a clue.
Put a break point at line 239 where the movefile() is. Let it run and pause at line 239. Make sure both the source and destination exist.
17 comentarios
Oluwadamilola Oke
el 22 de Jul. de 2024
Fangjun Jiang
el 22 de Jul. de 2024
At this moment, run the following to make sure both the source and destination exist. The return value should be non-zero.
exist(iad_output_file)
exist(fullfile(pwd, 'results'))
Walter Roberson
el 22 de Jul. de 2024
zsh:1: command not found: iad
I think that is your real problem. An executable named iad is needed in your current directory or on the system path.
Note that any PATH you might be setting in your .zshrc is going to be ignored by MATLAB: MATLAB is started from the dock rather than from a terminal session, so MATLAB does not go through zsh startup procedures.
Oluwadamilola Oke
el 22 de Jul. de 2024
Walter Roberson
el 22 de Jul. de 2024
Mac do not run .exe (not unless you have Parallels or equivalent installed)
Oluwadamilola Oke
el 24 de Jul. de 2024
Walter Roberson
el 24 de Jul. de 2024
Oluwadamilola Oke
el 24 de Jul. de 2024
Walter Roberson
el 24 de Jul. de 2024
You download the Unix distribution as a zip. Unzip it. Then open a command window to the appropriate directory, and give the (unix) command
make
Note: I am currently investigating the Makefile's use of ctangle -- at the moment make probably gets stuck
Walter Roberson
el 24 de Jul. de 2024
The Makefile invokes a program ctangle that you are unlikely to have installed on your Mac.
I found the binary at https://mmix.cs.hm.edu/osx/index.html . The link there is directly to the binary. Right-click and Save As.
Once you have the binary, you will need to
chmod +x ctangle
Then
PATH=$PATH:/directory/that/you/stored/ctangle make
Unfortunately this leads to the message
ctangle -bhp ad_main.w
! Input line too long. (l. 290)
fprintf(stdout, " 8) bbottomslide = optical depth of bottom slide (for absorbing slides)\n")
(ad_main.c)
(Pardon me, but I think I spotted something wrong.)
If you edit that line to be
fprintf(stdout, " 8) bbottomslide = opt. depth of bottom slide (for absorbing slides)\n")
then it will compile, eventually creating the iad executable.
Oluwadamilola Oke
el 25 de Jul. de 2024
Oluwadamilola Oke
el 25 de Jul. de 2024
Walter Roberson
el 25 de Jul. de 2024
The chmod and the make must be entered at the Terminal utility
Oluwadamilola Oke
el 25 de Jul. de 2024
Walter Roberson
el 25 de Jul. de 2024
Visit https://developer.apple.com/xcode/resources/ and select "View downloads" under "Additional tools". That will prompt you to log in to Developer program. You might need to create a new account (it just uses AppleID but you have to specifically sign up for it.) Accounts are free.
Once signed in, you will be at
Search for "Command Line Tools for Xcode 16 beta 4" or similar, adjusting for your XCode version. Download and install the .dmg that results.
After that, you will need to start XCode once, and agree to the license. You can quit XCode after that -- you just need it for the purpose of agreeing to the license.
Oluwadamilola Oke
el 25 de Jul. de 2024
Sunil
el 3 de Ag. de 2024
Categorías
Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!