Convert this C program into matlab. Please help. Stuck very badly as con[i][j] matrix is showing decimal nos. like 23.33(which is obviously not accepted in indexing in matlab).That error is showing in MG_matrix[con[eltn][i] - 1][con[eltn][j] - 1]
1 次查看(过去 30 天)
显示 更早的评论
for (ip=0;ip<9;ip++)
{
Ms3_matrix[i][j]=Ms3_matrix[i][j]+w3(epsilon3)*J*NTM_matrix[i][ip]*N_matrix[ip][j];
Mte3_matrix[i][j]=Ms3_matrix[i][j];
}
for (i = 0; i <27; i++)
{
for (j = 0; j < 27; j++)
{
Mte6_matrix[i][j]=0;
}
}
for (i = 0; i <27; i++)
{
for (j = 0; j < 27; j++)
{
Mte_matrix[i][j]=0;
/* *****************************Total Element Mass Matrix or Local Mass matrix(Kte_matrix)*************************** */
Mte_matrix[i][j]= Mte_matrix[i][j]+Mte3_matrix[i][j]+Mte6_matrix[i][j];
}
}
for (i = 0; i <30; i++)
{
for (j = 0; j <27; j++)
con[i][j]=58*(j/3)+j+2*i+1
}
}
for (i = 0; i <27; i++)
{
for (j = 0; j <27; j++)
MG_matrix[con[eltn][i] - 1][con[eltn][j] - 1] = Mte_matrix[i][j]; (ERROR HERE)
}
6 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!