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!