Why different results showing for laptop and desktop

1 次查看(过去 30 天)
I have used the same code to get the outputs.
  1. In my laptop the code executes correctly. It shows the result what I am expecting.
  2. 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
  1 个评论
Steven Lord
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
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.

类别

Help CenterFile Exchange 中查找有关 Vibration Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by