clc;
clear all ;
n=44;
for i=1:n
structName(i).data=readtable(sprintf('layer%d.dat',i));
end
for i=1:n
structName(i).data.Properties.VariableNames = {'NODE','SX','SY', 'SZ', 'SXY','SYZ','SXZ','Var8','Var9','Var10','Var11'};
end
for i=1:n
structName(i).data= removevars(structName(i).data,{'SY', 'SZ', 'SXY','SYZ','SXZ','Var8','Var9','Var10','Var11'});
end
for i=1:n
structName(i).data=structName(i).data(~any(ismissing(structName(i).data),2),:);
end
for i=1:n
structName(i).data_new1=zeros(224,2);
end
for i=1:n
structName(i).data_new=table2array(structName(i).data);
end
figure;
hold on
for ii = 1:n
plot(structName(ii).data_new(:,1),structName(ii).data_new(:,2));
end
E = (structName(1).data_new(:,1));
for i=1:n
E(:,i+1)=(structName(i).data_new(:,2));
end
P=zeros(224,2);
P(:,1)=structName(1).data_new(:,1);
for i=1:224
P(i,2)=sum(E(i,2:n)*0.23)/(0.23*n);
end
figure;
plot(P(:,1),P(:,2))
Best Answer