Filter löschen
Filter löschen

I am writing an FEM code in matlab. I want to make the sizes of repmat(N_dash, 3, 1) and repelem(ey.', 3, 1) the exact same. Original size of repmat(N_dash, 3, 1) is 3x3 and that of repelem(ey.', 3, 1) is 9x1. Any help will be much appreciated.

2 Ansichten (letzte 30 Tage)
for epsilon3=-1:1:1
N_dash(1)=-0.5+epsilon3;
N_dash(2)=-2*epsilon3;
N_dash(3)=0.5+epsilon3;
end
ly=(x(5)-x(2)); (x,y,z are constants like 0.9876,0.8876..etc)
my=(y(5)-y(2));
ny=(z(5)-z(2));
lve=sqrt(((ly)^2)+((my)^2)+((ny)^2)); %%vertical length of element
ey = [ly; my; ny] / lve;
A=repmat(N_dash, 3, 1) .* repelem(ey.', 3, 1)

Akzeptierte Antwort

madhan ravi
madhan ravi am 24 Okt. 2018
Bearbeitet: madhan ravi am 24 Okt. 2018
a=repelem(ey.', 3, 1)
a= reshape(a,3,3) %and then multiply a with repmat
A=repmat(N_dash, 3, 1) .* a
  26 Kommentare
madhan ravi
madhan ravi am 25 Okt. 2018
Bearbeitet: madhan ravi am 25 Okt. 2018
Really really glad that I was able to help because you were struggling for days with this problem.
Virajan Verma
Virajan Verma am 25 Okt. 2018
Yes i was really struggling. Its people like u who support others. Really thanks for ur valuable suggestions and time.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by