Why different results showing for laptop and desktop

2 ビュー (過去 30 日間)
J M Raisul Islam
J M Raisul Islam 2024 年 4 月 12 日
コメント済み: Steven Lord 2024 年 4 月 15 日
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 Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by