You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How can i edit my code which works on r2014b version at work but not on my personal r2024a version?
73 views (last 30 days)
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
Hi Walter, thank you. Unfortunately, this did not work. MATLAB gives the same error but this time with the fullfile()
Answers (1)
Fangjun Jiang
on 19 Jul 2024
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
Thank you Fangjun, I have inserted a breakpoint using the dbstop command. Please explain what you mean by ensure the source and destinaton exist? Usually, I create an empty results folder on my computer and the code should save the various Sample 1, 2, 3...# results into that folder (# = number of samples I'm processing at that time) . So i end up having .rxt and .txt files for each of my samples. However, it seems in the r2024a version, the code keeps getting hung up at line 239 after only creating sample1.rxt.
This is what I get after running the dbstop command:
Running IAD on dataset 1
zsh:1: command not found: iad
Sample1_IAD.txt
K>> IAD_Analyzer_WCV_04_11_23
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
Thank you both. Exist(iad_output_file) gives me 0, the latter gives me a non-zero number. I think this is the problem as Walter mentioned, I do have a .exe file in the folder but after checking it seems it is empty. After reading online, it seems mac systems are not equipped for running .exe files which may be the reason the current file in my folder is empty.
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
Yes, I will have to find alternate solution to run my codes when working at home. Thank you for all the help
Oluwadamilola Oke
on 24 Jul 2024
Yes, that is the code. I found that page earlier which includes the github links. But I could not understand which link I should be downloading for use on my mac as it gave two options: one for Windows and another for a unix distribution (unsure what this one is)
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
Hi Walter, thanks so much. In following your directions, I have added the unix file to my computer. Opened it on my matlab and added to path. downloaded the ctangle.txt file and also added it to the unix folder which is in my current matlab directory. I then used the chmod +x ctangle. but i get the error:
Unrecognized function or variable 'chmod'.
Did you mean:
>> mod +x ctangle
Using mod also does not make a difference. I get an error.
Please let me know what I have missed. Thank you
Oluwadamilola Oke
on 25 Jul 2024
Also entering the command make does not give any results. I entered it both into matlab and my mac terminal
Oluwadamilola Oke
on 25 Jul 2024
yes thank you. but the make cmd keeps giving this message in terminal:
xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See `man xcode-select` for more details.
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.
See Also
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!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)