フィルターのクリア

How to update a matrix with the node number

1 回表示 (過去 30 日間)
Boni_Pl
Boni_Pl 2019 年 5 月 5 日
編集済み: per isakson 2019 年 5 月 5 日
Hello
I have a circular geometry which is discretised by triangular elements. Now suppose the total number of triangle is 4 with 3 nodes like T=[1 2 3;6 5 8;8 11 4;10 3 12] and boundary nodes are B=[1 3 5 10 12]. Now boundary condition for each boundary node of a triangle Q=7.5 and size of Q is 3x3.
Q=zeros(3,3);
for i=1:size(T,1)
n=T(i,:) %nodes of each triangle
z=intersect(n,B); %boundary node present in each triangle
if(z==n(1,1))
Q(1,1)=7.5;
if(z==n(1,2))
Q(2,1)=7.5;
if(z==n(1,3))
Q(3,1)=7.5;
end
end
end
end
This code is not working. I didn't get the matrix like for 1st triangle Q=[7.5 0 0;0 0 0;7.5 0 0], for 2nd triangle Q=[0 0 0;7.5 0 0;0 0 0], for 3rd triangle Q=[0 0 0;0 0 0;0 0 0], for 4th triangle Q=[7.5 0 0;7.5 0 0;7.5 0 0]
Please help me.

回答 (0 件)

カテゴリ

Help Center および File ExchangeComputational Geometry についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by