Index in position 2 exceeds array bounds (must not exceed 1).
1 次查看(过去 30 天)
显示 更早的评论
for elem=1:ne %Calling elements
for i=1:4
for j=1:4
if (elem(i,4)==1)
k=eval(['k',num2str(elem),'l']);
else
k=eval(['k',num2str(elem),'l']);
KG(i,j)=k(i,j)+KG(i,j);
end
end
end
end
0 个评论
回答(1 个)
Chris
2019-8-19
Your first line is making "elem" a scalor but the if test is using it as a martix; this does not work.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!