Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to solve INDEX OUT OF BOUNDS ERROR? Please help me. Stuck in this for the past 10 days.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
eltn=30;
%%(b)Element Connectivity Table
count = 0 ;
conn = zeros([],3) ;
for i=1:30
for j=1:27
count = count+1 ;
conn(count,:) =[j,j+1,j+2]
end
end
%Here the Code for Assembling (OR) Global Mass Matrix
%x(i,j)=Kte_matrix(i,j); %DOUBT +=
for i=1:27
for j=1:27
MG_matrix(conn(eltn,i) - 1,conn(eltn,j) - 1)= Mte_matrix(i,j); (ERROR HERE)
end
end
How to convert conn matrix in this range??
Attempted to access conn(30,4); index out of bounds because size(conn)=[810,3].
Error in practisee2 (line 558) MG_matrix(conn(eltn,i) - 1,conn(eltn,j) - 1)= Mte_matrix(i,j);
11 comentarios
Walter Roberson
el 12 de Nov. de 2018
That is quite different initialisation than what you had before.
Respuestas (1)
KSSV
el 12 de Nov. de 2018
Check the function assemble in the link. This will help you.
8 comentarios
Stephen23
el 13 de Nov. de 2018
Editada: Stephen23
el 13 de Nov. de 2018
"The value of conn(eltn,j) for j=1 should be 59. How can it be zero??"
Who said that j is equal to one when that error occurs? I don't see anything in your code that means that j equals one when that error occurs. Try looking at the value of j after the error has occured, and you might just learn something about your code.
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!