Matlab running a script I executed first no matter which script I try to run
21 views (last 30 days)
Show older comments
Like the title says, I tried a code for a program and ran the program but now no matter what other script I run, it is always this one script. I have tried removing the script, deleting it but it keeps running only that one script. On top of this, none of the variables show up in the workspace. All the previous scripts are confirmed to have worked before I tried this script but I don't know what is causing it after I ran that script. This is on the online version of MATLAB which used to run all of the previous scripts.
2 Comments
Dyuman Joshi
on 18 Jan 2023
Unless we have the code, we will not be able to (magically) tell what's wrong.
So, please attach your code.
Answers (1)
Star Strider
on 18 Jan 2023
Check to see if you have a copy of it somewhere. MATLAB may be running the copy and ignoring the version you want to run, or it may be running the version you want to run first, and then the other version, so the output never changes.
Also, be sure the version you want to run is saved in the MATLAB search path (What Is the MATLAB Search Path?).
2 Comments
dpb
on 18 Jan 2023
To see what MATLAB thinks are available versions of the specific function/script, type
which -all yourscriptOrfunctionname
Use the script name in place of the above placeholder, of course.
Also, another possibility is you've inadvertently saved the m-file of your script that you're making edits in with the wrong filename -- a misspelling or capitalization difference, MATLAB function and variable names are case sensitive even though on Windoes file names are case-preserving but not case sensitive.
See Also
Categories
Find more on Get Started with MATLAB 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!