Why different results showing for laptop and desktop
1 次查看(过去 30 天)
显示 更早的评论
I have used the same code to get the outputs.
- In my laptop the code executes correctly. It shows the result what I am expecting.
- In my desktop the code doesn't work. It shows the errors like this:
Arrays have incompatible sizes for this operation.
Error in run19>plotFatigueLife (line 37)
predictedCycles = cumsum(cycles .* (1 + (0.05 * time))); % Example model
Error in run19>fatigue (line 19)
plotFatigueLife(filepath, reference_cycle, years);
Error in run19 (line 7)
fatigue();
Please answer my questions. I am facing a lot of problems. Thank you
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1667516/image.png)
1 个评论
Steven Lord
2024-4-15
The screen shot of your laptop's installation of MATLAB indicates you're using release R2023a. But I can't tell from the screen shot of your desktop which release you're using. Are you using a significantly older release of MATLAB on your desktop machine?
It's also not completely clear from the screen shots that you're running the exact same code on the two machines. On your laptop the run19.m file you're running is in "E:\WT\March 28, 2024\OpenFAST\Run\5MW_OC4Semi_WSt_WavesWN" while on the desktop machine the run19.m file is in "C:\Users\J M Raisul Islam\Dropbox\Dropbox\Family Room\Raisul\Run\Run\5MW_OC4Semi_Wst_WavesWN". Are those the same file? Can you post the body of the plotFatigueLife local function from those two run19.m files (at least through line 37, where the error occurs)?
回答(1 个)
Taylor
2024-4-15
Hard to say without seeing the code itself, but my first instinct would be to check if you are calling any hardcoded paths. If this is the source of the issue, I recommend looking into MATLAB projects. They afford you the ability to define the startup folder so that you don't have to hardcode path names.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vibration Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!