c语言sscanf函数的用法是什么
309
2022-08-22
神经网络预测应力应变-单轴实验
1、内容简介
略 492-可以交流、咨询、答疑
2、内容说明
clear clc close all %% ------------ 提取数据 ------------ % 单轴实验.xlsx data_C50_0 = xlsread('单轴实验.xlsx','Sheet1','A4:B58'); data_6_02_0 = xlsread('单轴实验.xlsx','Sheet1','C4:D66'); data_6_04_0 = xlsread('单轴实验.xlsx','Sheet1','E4:F61'); data_6_06_0 = xlsread('单轴实验.xlsx','Sheet1','G4:H62');
data_12_02_0 = xlsread('单轴实验.xlsx','Sheet1','I4:J59'); data_12_04_0 = xlsread('单轴实验.xlsx','Sheet1','K4:L57'); data_12_06_0 = xlsread('单轴实验.xlsx','Sheet1','M4:N61');
data_18_02_0 = xlsread('单轴实验.xlsx','Sheet1','O4:P50'); data_18_04_0 = xlsread('单轴实验.xlsx','Sheet1','Q4:R62'); data_18_06_0 = xlsread('单轴实验.xlsx','Sheet1','S4:T60');
% 5MPa.xlsx data_C50_5 = xlsread('5MPa.xlsx','Sheet1','A3:B34'); data_6_02_5 = xlsread('5MPa.xlsx','Sheet1','C3:D52'); data_6_04_5 = xlsread('5MPa.xlsx','Sheet1','E3:F55'); data_6_06_5 = xlsread('5MPa.xlsx','Sheet1','G3:H35');
data_12_02_5 = xlsread('5MPa.xlsx','Sheet1','I3:J33'); data_12_04_5 = xlsread('5MPa.xlsx','Sheet1','K3:L51'); data_12_06_5 = xlsread('5MPa.xlsx','Sheet1','M3:N39');
data_18_02_5 = xlsread('5MPa.xlsx','Sheet1','O3:P35'); data_18_04_5 = xlsread('5MPa.xlsx','Sheet1','Q3:R42'); data_18_06_5 = xlsread('5MPa.xlsx','Sheet1','S3:T42');
% 10MPa.xlsx data_C50_10 = xlsread('10MPa.xlsx','Sheet1','A3:B40'); data_6_02_10 = xlsread('10MPa.xlsx','Sheet1','C3:D57'); data_6_04_10 = xlsread('10MPa.xlsx','Sheet1','E3:F44'); data_6_06_10 = xlsread('10MPa.xlsx','Sheet1','G3:H57');
data_12_02_10 = xlsread('10MPa.xlsx','Sheet1','I3:J42'); data_12_04_10 = xlsread('10MPa.xlsx','Sheet1','K3:L58'); data_12_06_10 = xlsread('10MPa.xlsx','Sheet1','M3:N42');
data_18_02_10 = xlsread('10MPa.xlsx','Sheet1','O3:P38'); data_18_04_10 = xlsread('10MPa.xlsx','Sheet1','Q3:R44'); data_18_06_10 = xlsread('10MPa.xlsx','Sheet1','S3:T53');
% 15MPa.xlsx data_C50_15 = xlsread('5MPa.xlsx','Sheet1','A3:B62'); data_6_02_15 = xlsread('15MPa.xlsx','Sheet1','C3:D50'); data_6_04_15 = xlsread('15MPa.xlsx','Sheet1','E3:F49'); data_6_06_15 = xlsread('15MPa.xlsx','Sheet1','G3:H55');
data_12_02_15 = xlsread('15MPa.xlsx','Sheet1','I3:J52'); data_12_04_15 = xlsread('15MPa.xlsx','Sheet1','K3:L59'); data_12_06_15 = xlsread('15MPa.xlsx','Sheet1','M3:N40');
data_18_02_15 = xlsread('15MPa.xlsx','Sheet1','O3:P54'); data_18_04_15 = xlsread('15MPa.xlsx','Sheet1','Q3:R57'); data_18_06_15 = xlsread('15MPa.xlsx','Sheet1','S3:T52');
%% 数据融合处理,生成BP需要的数据量 pressure = []; fibre_length = []; volume_percentage = []; x = []; y = []; %------------------单轴数据------------------------------------------ pressure = [pressure zeros(length(data_C50_0),1)]; fibre_length = [fibre_length zeros(length(data_C50_0),1)]; volume_percentage = [volume_percentage zeros(length(data_C50_0),1)]; x = [x data_C50_0(:,1)]; y = [y data_C50_0(:,2)];
pressure = [pressure; zeros(length(data_6_02_0),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_02_0),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_0),1)]; x = [x; data_6_02_0(:,1)]; y = [y; data_6_02_0(:,2)]; pressure = [pressure; zeros(length(data_6_04_0),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_04_0),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_0),1)]; x = [x; data_6_04_0(:,1)]; y = [y; data_6_04_0(:,2)]; pressure = [pressure; zeros(length(data_6_06_0),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_06_0),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_0),1)]; x = [x; data_6_06_0(:,1)]; y = [y; data_6_06_0(:,2)];
pressure = [pressure; zeros(length(data_12_02_0),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_02_0),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_0),1)]; x = [x; data_12_02_0(:,1)]; y = [y; data_12_02_0(:,2)]; pressure = [pressure; zeros(length(data_12_04_0),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_04_0),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_0),1)]; x = [x; data_12_04_0(:,1)]; y = [y; data_12_04_0(:,2)]; pressure = [pressure; zeros(length(data_12_06_0),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_06_0),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_0),1)]; x = [x; data_12_06_0(:,1)]; y = [y; data_12_06_0(:,2)];
pressure = [pressure; zeros(length(data_18_02_0),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_02_0),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_0),1)]; x = [x; data_18_02_0(:,1)]; y = [y; data_18_02_0(:,2)]; pressure = [pressure; zeros(length(data_18_04_0),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_04_0),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_0),1)]; x = [x; data_18_04_0(:,1)]; y = [y; data_18_04_0(:,2)]; pressure = [pressure; zeros(length(data_18_06_0),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_06_0),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_0),1)]; x = [x; data_18_06_0(:,1)]; y = [y; data_18_06_0(:,2)];
%------------------5MPa数据------------------------------------------ pressure = [pressure; 5*ones(length(data_C50_5),1)]; fibre_length = [fibre_length; zeros(length(data_C50_5),1)]; volume_percentage = [volume_percentage; zeros(length(data_C50_5),1)]; x = [x; data_C50_5(:,1)]; y = [y; data_C50_5(:,2)];
pressure = [pressure; 5*ones(length(data_6_02_5),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_02_5),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_5),1)]; x = [x; data_6_02_5(:,1)]; y = [y; data_6_02_5(:,2)]; pressure = [pressure; 5*ones(length(data_6_04_5),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_04_5),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_5),1)]; x = [x; data_6_04_5(:,1)]; y = [y; data_6_04_5(:,2)]; pressure = [pressure; 5*ones(length(data_6_06_5),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_06_5),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_5),1)]; x = [x; data_6_06_5(:,1)]; y = [y; data_6_06_5(:,2)];
pressure = [pressure; 5*ones(length(data_12_02_5),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_02_5),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_5),1)]; x = [x; data_12_02_5(:,1)]; y = [y; data_12_02_5(:,2)]; pressure = [pressure; 5*ones(length(data_12_04_5),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_04_5),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_5),1)]; x = [x; data_12_04_5(:,1)]; y = [y; data_12_04_5(:,2)]; pressure = [pressure; 5*ones(length(data_12_06_5),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_06_5),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_5),1)]; x = [x; data_12_06_5(:,1)]; y = [y; data_12_06_5(:,2)];
pressure = [pressure; 5*ones(length(data_18_02_5),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_02_5),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_5),1)]; x = [x; data_18_02_5(:,1)]; y = [y; data_18_02_5(:,2)]; pressure = [pressure; 5*ones(length(data_18_04_5),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_04_5),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_5),1)]; x = [x; data_18_04_5(:,1)]; y = [y; data_18_04_5(:,2)]; pressure = [pressure; 5*ones(length(data_18_06_5),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_06_5),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_5),1)]; x = [x; data_18_06_5(:,1)]; y = [y; data_18_06_5(:,2)];
%------------------10MPa数据------------------------------------------ pressure = [pressure; 10*ones(length(data_C50_10),1)]; fibre_length = [fibre_length; zeros(length(data_C50_10),1)]; volume_percentage = [volume_percentage; zeros(length(data_C50_10),1)]; x = [x; data_C50_10(:,1)]; y = [y; data_C50_10(:,2)];
pressure = [pressure; 10*ones(length(data_6_02_10),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_02_10),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_10),1)]; x = [x; data_6_02_10(:,1)]; y = [y; data_6_02_10(:,2)]; pressure = [pressure; 10*ones(length(data_6_04_10),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_04_10),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_10),1)]; x = [x; data_6_04_10(:,1)]; y = [y; data_6_04_10(:,2)]; pressure = [pressure; 10*ones(length(data_6_06_10),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_06_10),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_10),1)]; x = [x; data_6_06_10(:,1)]; y = [y; data_6_06_10(:,2)];
pressure = [pressure; 10*ones(length(data_12_02_10),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_02_10),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_10),1)]; x = [x; data_12_02_10(:,1)]; y = [y; data_12_02_10(:,2)]; pressure = [pressure; 10*ones(length(data_12_04_10),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_04_10),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_10),1)]; x = [x; data_12_04_10(:,1)]; y = [y; data_12_04_10(:,2)]; pressure = [pressure; 10*ones(length(data_12_06_10),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_06_10),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_10),1)]; x = [x; data_12_06_10(:,1)]; y = [y; data_12_06_10(:,2)];
pressure = [pressure; 10*ones(length(data_18_02_10),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_02_10),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_10),1)]; x = [x; data_18_02_10(:,1)]; y = [y; data_18_02_10(:,2)]; pressure = [pressure; 10*ones(length(data_18_04_10),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_04_10),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_10),1)]; x = [x; data_18_04_10(:,1)]; y = [y; data_18_04_10(:,2)]; pressure = [pressure; 10*ones(length(data_18_06_10),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_06_10),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_10),1)]; x = [x; data_18_06_10(:,1)]; y = [y; data_18_06_10(:,2)];
%------------------15MPa数据------------------------------------------ pressure = [pressure; 15*ones(length(data_C50_15),1)]; fibre_length = [fibre_length; zeros(length(data_C50_15),1)]; volume_percentage = [volume_percentage; zeros(length(data_C50_15),1)]; x = [x; data_C50_15(:,1)]; y = [y; data_C50_15(:,2)];
pressure = [pressure; 15*ones(length(data_6_02_15),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_02_15),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_15),1)]; x = [x; data_6_02_15(:,1)]; y = [y; data_6_02_15(:,2)]; pressure = [pressure; 15*ones(length(data_6_04_15),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_04_15),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_15),1)]; x = [x; data_6_04_15(:,1)]; y = [y; data_6_04_15(:,2)]; pressure = [pressure; 15*ones(length(data_6_06_15),1)]; fibre_length = [fibre_length; 6*ones(length(data_6_06_15),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_15),1)]; x = [x; data_6_06_15(:,1)]; y = [y; data_6_06_15(:,2)];
pressure = [pressure; 15*ones(length(data_12_02_15),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_02_15),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_15),1)]; x = [x; data_12_02_15(:,1)]; y = [y; data_12_02_15(:,2)]; pressure = [pressure; 15*ones(length(data_12_04_15),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_04_15),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_15),1)]; x = [x; data_12_04_15(:,1)]; y = [y; data_12_04_15(:,2)]; pressure = [pressure; 15*ones(length(data_12_06_15),1)]; fibre_length = [fibre_length; 12*ones(length(data_12_06_15),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_15),1)]; x = [x; data_12_06_15(:,1)]; y = [y; data_12_06_15(:,2)];
pressure = [pressure; 15*ones(length(data_18_02_15),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_02_15),1)]; volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_15),1)]; x = [x; data_18_02_15(:,1)]; y = [y; data_18_02_15(:,2)]; pressure = [pressure; 15*ones(length(data_18_04_15),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_04_15),1)]; volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_15),1)]; x = [x; data_18_04_15(:,1)]; y = [y; data_18_04_15(:,2)]; pressure = [pressure; 15*ones(length(data_18_06_15),1)]; fibre_length = [fibre_length; 18*ones(length(data_18_06_15),1)]; volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_15),1)]; x = [x; data_18_06_15(:,1)]; y = [y; data_18_06_15(:,2)];
% 准备BP神经网络的输入数据 input = [pressure, fibre_length, volume_percentage, x]; output = y; % 打乱数据 flagTrain = length(output); order = randperm(flagTrain); nbertrain = round(0.7*flagTrain);% 提取训练和验证数据 70% 训练,30% 验证 XTrain = input(order(1:nbertrain),:); YTrain = output(order(1:nbertrain)); XValidation = input(order(nbertrain+1:flagTrain),:); YValidation = output(order(nbertrain+1:flagTrain));
3、仿真分析
4、参考论文
略
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~