Why different results showing for laptop and desktop

2 views (last 30 days)
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 Comment
Steven Lord
Steven Lord on 15 Apr 2024
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)?

Sign in to comment.

Answers (1)

Taylor
Taylor on 15 Apr 2024
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.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!