Same code in different system giving different output
显示 更早的评论
I’ve written a code that collects data from an Excel file, then enters a while loop for iteration using fminsearch along with two custom functions I’ve developed. The loop exits based on a specific breaking condition. All my files are stored in a OneDrive folder, which I can access both from my desktop and my laptop.
However, I’m experiencing an issue: When I run the code on my desktop, it completes 114 iterations, while on my laptop, it runs for 314 iterations. Additionally, the output values differ between the two systems. Since the code file is located in OneDrive, I’m using the exact same code (without copying or making separate files). The only difference in the code is how it reads the Excel file—I modify the file path depending on whether I’m working on my desktop or laptop, and I handle this through commented-out lines. I am using the same version of matlab in both system.
Could anyone kindly provide insight into why this is happening? I would also appreciate any suggestions on how I can ensure consistent results across both systems.
3 个评论
Mike Croucher
2024-9-19
Is it possible to show the code and data?
H M Dilshad Alam
2024-9-19
Walter Roberson
2024-9-19
Can you attach the data?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!