How do I fix the error displayed on the code below

2 ビュー (過去 30 日間)
theopister
theopister 2025 年 4 月 17 日
回答済み: Cris LaPierre 2025 年 4 月 17 日

回答 (1 件)

Cris LaPierre
Cris LaPierre 2025 年 4 月 17 日
Your variable K_global does not have as many rows as you expected. Specifically, it only has 9, so we have to assume that your indexing variable, dof_map > 9, resulting in an indexing error.
You need to figure out why it is not the size you expected.
Here's a quick recreation of the error.
K_global = rand(9,2);
K_global(10,2)
Index in position 1 exceeds array bounds. Index must not exceed 9.

Community Treasure Hunt

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

Start Hunting!

Translated by