-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData_conversion.m
40 lines (35 loc) · 1.25 KB
/
Data_conversion.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function Data_conversion(Ip, Test)
% clc
thruster_test = 'RIT_XT';
% clear all
folder_name = ['C:\Users\shita\Box\Simulation\OSU-DSPG\particleTest\Topology_Generation_Data\Test_Data\' thruster_test ];
S(1,1) = 1; %Row X1
S(1,2) = (Ip(1,10)*Ip(1,13))+1;
S(1,3) = Ip(1,10)*((Ip(1,11)-Ip(1,5))/2);
S(1,4) = Ip(1,10)*(Ip(1,13)+Ip(1,3));
S(1,5) = Ip(1,8);
S(2,1) = S(1,3) + (Ip(1,10)*Ip(1,5))+1;
S(2,2) = S(1,2);
S(2,3) = Ip(1,10)*Ip(1,12);
S(2,4) = S(1,4);
S(2,5) = Ip(1,8);
A(1,1) = 1;
A(1,2) = Ip(1,10)*(Ip(1,13)+Ip(1,3)+Ip(1,7))+1;
A(1,3) = Ip(1,10)*((Ip(1,11)-Ip(1,6))/2);
A(1,4) = Ip(1,10)*(Ip(1,13)+Ip(1,3)+Ip(1,4) +Ip(1,7));
A(1,5) = Ip(1,9);
A(2,1) = A(1,3) + (Ip(1,10)* Ip(1,6))+1;
A(2,2) = A(1,2);
A(2,3) = Ip(1,10)*Ip(1,12);
A(2,4) = A(1,4);
A(2,5) = Ip(1,9);
if isfolder(folder_name)
writematrix( S, [folder_name '\Test' num2str(Test) '_Grid_points.xlsx'],'Sheet',1,'Range','C2:G4');
writematrix( A, [folder_name '\Test' num2str(Test) '_Grid_points.xlsx'],'Sheet',2,'Range','C2:G4');
disp(S)
else
mkdir(fullfile(folder_name))
writematrix( S, [folder_name '\Test' num2str(Test) '_Grid_points.xlsx'],'Sheet',1,'Range','C2:G4');
writematrix( A, [folder_name '\Test' num2str(Test) '_Grid_points.xlsx'],'Sheet',2,'Range','C2:G4');
disp('2')
end