Mystery Error; same code runs fine the 2nd time, but not the 1st!
20 ビュー (過去 30 日間)
表示 古いコメント
The 1st run produces this error: "Unable to perform assignment because the left and right sides have a different number of elements." The same exact identical code, works fine the 2nd time around. What gives? Installation issues? Cache problems?
MATLAB Version: 9.6.0.1099231 (R2019a) Update 1
4 件のコメント
Jan
2019 年 6 月 24 日
It would be useful, if you post the error message. I guess "the main code" is "Euler_Main_All.m".
採用された回答
Jan
2019 年 6 月 21 日
Without seeing the relevant part of the code, answering is based on guessing.
I guess, that your code is a script and not a function. Inside the script some variables are defined at the first run such that the second run can use them.
Neither "installation issues" nor "cache problems" are standing to reason. Most likely this is a simple programming error. You can use the debugger to test this. Another approach is to convert the script into a function, and check, if the problem occurs every time. Then you know that the data shared with previous runs is the source of the different behaviour.
その他の回答 (0 件)
参考
カテゴリ
Find more on Matrix Indexing 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!