Same code in different system giving different output
Mostrar comentarios más antiguos
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 comentarios
Mike Croucher
el 19 de Sept. de 2024
Is it possible to show the code and data?
H M Dilshad Alam
el 19 de Sept. de 2024
Walter Roberson
el 19 de Sept. de 2024
Can you attach the data?
Respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!