How can i edit my code which works on r2014b version at work but not on my personal r2024a version?
Show older comments
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 Comments
Walter Roberson
on 19 Jul 2024
movefile(iad_output_file,strcat([pwd, '\results']))
You should be using fullfile() instead
movefile(iad_output_file,fullfile(pwd, 'results'))
Oluwadamilola Oke
on 22 Jul 2024
Answers (1)
Fangjun Jiang
on 19 Jul 2024
0 votes
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 Comments
Oluwadamilola Oke
on 22 Jul 2024
Fangjun Jiang
on 22 Jul 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
on 22 Jul 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
on 22 Jul 2024
Walter Roberson
on 22 Jul 2024
Mac do not run .exe (not unless you have Parallels or equivalent installed)
Oluwadamilola Oke
on 24 Jul 2024
Walter Roberson
on 24 Jul 2024
Oluwadamilola Oke
on 24 Jul 2024
Walter Roberson
on 24 Jul 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
on 24 Jul 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
on 25 Jul 2024
Oluwadamilola Oke
on 25 Jul 2024
Walter Roberson
on 25 Jul 2024
The chmod and the make must be entered at the Terminal utility
Oluwadamilola Oke
on 25 Jul 2024
Walter Roberson
on 25 Jul 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
on 25 Jul 2024
Sunil
on 3 Aug 2024
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!