Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How do I derive a linear equation for wind speed between 13km/h –50km/h using “if-else”?
1 回表示 (過去 30 日間)
古いコメントを表示
for i = 1: length(Wind_Year)
if WindLight = nnz((Wind_Year >= 13) & (Wind_Year < 50));
Power = m * x + c;
Power = m * WindLight + c;
Power1 =[Power1; Power];
Day1 = [Day1; i];
elseif WindHeavy = nnz((Wind_Year >= 50) & (Wind_Year <= 100));
Power = m * x + c;
Power = m * WindHeavy + c;
Power2 = [Power2; Power];
Day2 = [Day2; i];
end
end
The data (13 - 50) and (50 - 100) is coming from 12 spreadsheets.
0 件のコメント
回答 (1 件)
Andreas Bernatzky
2020 年 6 月 22 日
you have to index Wind_Year with your increment i.
For example Wind_Year(i) but heavily depends on what type of container your Wind_Year variable belongs to (Table,Vector,Cell...)
2 件のコメント
Andreas Bernatzky
2020 年 7 月 27 日
Hello Thomas,
sorry for the late reply. Maybe you can attach one of the (shorter) excel-Sheets?
Than I can have a better look on it.
Your code looks ok to me for iterating over all sheets.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!