Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Please help me check my code. It is displaying one answer instead of series of answers. Thank you.

1 Ansicht (letzte 30 Tage)
a = 0.5;
b = 0.1;
E = 0.2;
v = 0.3;
Y= (E/(1-v^2));
ve = [1 v 0; v 1 0; 0 0 (1-v)/2];
uu = [-0.02 0.012 -1.23 0.2343 -0.124 1.111 0.214 0.453];
for i = 1:length(nu);
for j = 1:length(eta);
nu = -1:0.01:1;
eta = -1:0.01:1;
B(i,j) = [-(1-nu)/(4*a) 0 (1-nu)/(4*a) 0 (1+nu)/(4*a) 0 -(1+nu)/(4*a) 0;...
0 -(1-eta)/(4*b) 0 -(1+eta)/(4*b) 0 (1+eta)/(4*b) 0 (1-eta)/(4*b);...
-(1-eta)/(4*b) -(1-nu)/(4*a) -(1+eta)/(4*b) (1-nu)/(4*a) (1+eta)/(4*b) (1+nu)/(4*a) (1-eta)/(4*b) -(1+nu)/(4*a)];
e(i,j) = B(i,j)*uu';
sig(i,j) = Y.*ve*e(i,j); % calculate the sig for each of the count and store it in sigsig
end
end
sigsig = [sig(i,j)]; % store all the sig here, each sig as a row vector
  1 Kommentar
Walter Roberson
Walter Roberson am 20 Mär. 2017
Duplicates https://www.mathworks.com/matlabcentral/answers/330756-can-you-please-help-me-check-my-code-it-is-outputting-only-the-last-value-instead-of-all-the-values

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by