Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

can used for loop to solve this problem?

1 view (last 30 days)
Mary Jon
Mary Jon on 16 Nov 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
I am have this code
d=1:1:33;
E_0=8.854*1e-9; %(F/mm)
E_r=1;
E=(E_0*E_r).*ones(111,34);
E(2:5,d)=10*E_0;
E(7:10,d)=4*E_0;
Part=100*E_0;
E(30,2)=Part
for U=1 : 33
E(30,:)=circshift(E(30,:),[0 1]); % shift the particle step step in x direction of row 30
out{U}=E; %out put of each shifting case
end
celldisp(out)
this code shifting E(30,:) horizontaly in x axis , my question is How I can calculate other equations like q(i,j),W(i,j) after each shifting process ?that meaning I am must have 33 value of q(i,j)(one value of 33 to each shifting(circshift)? where equations of q(i,j) and W(i,j) is
for i=2:110
for j=2:33
W1(i, j)=(h.^2).*(E(i, j)+E(i, j-1));
W2(i, j)=(h.^2).*(E(i-1,j)+E(i-1, j-1));
W3(i, j)=E(i, j)+E(i-1, j);
W4(i, j)=E(i, j-1)+E(i-1, j-1);
W(i, j)=W1(i, j)+W2(i, j)+W3(i, j)+W4(i, j);
end
end
for j=14:21
q(i,j)=((E_0.*W(6,j))/(2*h))*[100-(W1(6,j).*(v_in(6+1,j))+W2(6,j).*(v_in(6-1,j))+W3(6,j).*(v_in(6,j+1))+W4(6,j).*(v_in(6,j-1)))./(W(6,j))];
end

Answers (0)

This question is closed.

Products

Community Treasure Hunt

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

Start Hunting!