MATLAB Answers

How to fix Index exceeds matrix dimensions error?

41 views (last 30 days)
Philip Liju
Philip Liju on 13 Jan 2021
Commented: Mathieu NOE on 14 Jan 2021
Kindly have a look at the errors.
Error in expression for 'project_wind/Wind Turbine/wind_speed^3', an input index exceeds its input width of 1
Error in port widths or dimensions. 'Output Port 1' of 'project_wind/Wind Turbine/Wind speed (m//s)' is a [1x1] matrix.


Sign in to comment.

Answers (1)

Mathieu NOE
Mathieu NOE on 13 Jan 2021
hello Philip
I corrected some minor bugs in matlab function blocks
also lambda_nom is not initialized so I took lambda_nom = 1 to run the code
last point you have to fix is that when pitch_angle is zero , there are division by zeros in your cp(lambda,beta) block
all the best,


Mathieu NOE
Mathieu NOE on 14 Jan 2021
so I found the bug in the block cp(lambda,beta) : the indexes of u[ ] were incorrect
the script and simulink gives me now the same values
last point to check : so lambda = 8.1 if wind speed = 12 m/ s ? so i put the gain accordingly - check this please
attached the updated file
Philip Liju
Philip Liju on 14 Jan 2021
This works as I want it to be. Thank you so much for your help .. Really appreciate it

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by