フィルターのクリア

Can you please help me check my code? It is outputting only the last value instead of all the values generated in for loop. Thank you.

1 回表示 (過去 30 日間)
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 件)

Walter Roberson
Walter Roberson 2017 年 3 月 20 日
In the line
for i = 1:length(nu);
nu has not yet been defined.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by