Index exceeds the number of array elements. Index must not exceed 4.
16 views (last 30 days)
Show older comments
Index exceeds the number of array elements. Index must not exceed 4. I get it in Simulink. I'm getting this error and I couldn't find a solution. Can you help me.
1 Comment
Walter Roberson
on 1 May 2024
That is not a helpful message :(
Testing, I see that the problem appears to be with the Multi-Winding Transformer -- but I cannot see any problems in the configuration of that block
Answers (1)
Chaitanya
on 6 May 2024
Hello Batuhan,
I understand that you are receiving the error “Index exceeds the number of array elements. Index must not exceed 4” while running the model that contains “Multi-Winding Transformer” block.
As suggested by Walter, the issue seems to be with the Multi-Winding Transformer. Upon debugging the provided model, I noticed that there is an issue with the parameters set in the block parameters.
In the block parameters of the Multi-Winding Transformer, in the parameters section, I notice that few of the parameters are not defined according to number windings defined.
In the configuration tab, the number of windings on the left side is 2 and the number of windings on the right side is 4. So, the total windings are 6. However, the following parameters set in the parameters tab are set to be an array of 4 elements. The array should contain 6 elements as there are 6 windings totally.
- Winding nominal voltages
- Winding resistance
- Winding leakage inductances
I further modified these parameters to have 6 elements instead of 4 elements and I was able to run the model without any errors.
I suggest you define the parameters accordingly to rectify the error that you are receiving.
For more information on the parameters please visit the following documentation that provides details that the array must contains ‘n’ number of elements where ‘n’ is number of windings.
I hope that the above information is helpful in resolving the error.
Thanks,
Chaitanya Krishna
1 Comment
Awatif ESHAIMI
on 8 Jun 2024
I got the same error, and thank's to your comment I found the solution, thank you !
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!