MATLAB - script generates another script faultlessly but has problems running it.
Show older comments
Hi,
This problem involves a script of over 1,000 lines, so please only read on if that's okay with you. I'm not a great coder, so it may not be efficient code, but I'm only a student. I have tried asking at a generic answer website, but had no joy, so I'm going to try here, too.
I've written a MATLAB script m-file which essentially finds out as much detail as it can from the given data, and writes another script m-file to brute force anything it cannot be sure of.
I find that I encounter problems when running the first script, when it reaches the point it needs to call the second script. The error changes places each time I run the program, and usually disappears if I open the second script file after the error and do something aesthetic, but not code-changing[*]. However, this is now useless, because the loop of the original script file has been terminated.
MATLAB appears to skip a line of the script, then throw the "subscript indices must be real positive integers or logicals" error; although, as far as I can see, there is no reason for it to skip a line, and, even though it has, the indices are all of the required type.
I have tried for many hours to figure out where I'm going wrong but I'm stumped. The files I've been using are here, written alone, beside the one taken from FEX, for which credit is given accordingly.
Thanks for any time you may waste trying to help. There is a readme m-file in the zip with some system details, and a more detailed explanation of what the code hopes to achieve.
Bob.
[*] For example, if I open the allegedly erroneous script m-file, use "select all", then "smart indent", only the number of spaces in the file is changed. However, MATLAB runs it perfectly afterwards.
Accepted Answer
More Answers (0)
Categories
Find more on Adding custom doc 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!