-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGeodesyBasicComputing.m
More file actions
1248 lines (1087 loc) · 58.3 KB
/
Copy pathGeodesyBasicComputing.m
File metadata and controls
1248 lines (1087 loc) · 58.3 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function varargout = GeodesyBasicComputing(varargin)
% GEODESYBASICCOMPUTING MATLAB code for GeodesyBasicComputing.fig
% GEODESYBASICCOMPUTING, by itself, creates a new GEODESYBASICCOMPUTING or raises the existing
% singleton*.
%
% H = GEODESYBASICCOMPUTING returns the handle to a new GEODESYBASICCOMPUTING or the handle to
% the existing singleton*.
%
% GEODESYBASICCOMPUTING('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GEODESYBASICCOMPUTING.M with the given input arguments.
%
% GEODESYBASICCOMPUTING('Property','Value',...) creates a new GEODESYBASICCOMPUTING or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before GeodesyBasicComputing_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to GeodesyBasicComputing_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help GeodesyBasicComputing
% Last Modified by GUIDE v2.5 23-Mar-2022 10:37:31
% Begin initialization code - DO NOT EDIT
gui_Singleton = 0;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GeodesyBasicComputing_OpeningFcn, ...
'gui_OutputFcn', @GeodesyBasicComputing_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before GeodesyBasicComputing is made visible.
function GeodesyBasicComputing_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to GeodesyBasicComputing (see VARARGIN)
% Choose default command line output for GeodesyBasicComputing
handles.output = hObject;
format long;
% Update handles structure
guidata(hObject, handles);
get(handles.Ellipsoid,'value');%获取选择的参考椭球
switch(get(handles.Ellipsoid,'value'))
case 1%北京54椭球
set(handles.DATA_a,'String',num2str(6378245.0,'%.10f'));%长半轴
set(handles.DATA_f,'String','1/298.3');%扁率
case 2%西安80椭球
set(handles.DATA_a,'String',num2str(6378140.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257');%扁率
case 3%CGCS2000椭球
set(handles.DATA_a,'String',num2str(6378137.0,'%.10f'));
set(handles.DATA_f,'String','1/298.25722210100');%扁率
case 4%WGS84椭球
set(handles.DATA_a,'String',num2str(6378137.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257223563');%扁率
case 5%克拉索夫斯基椭球
set(handles.DATA_a,'String',num2str(6378245.0,'%.10f'));%长半轴
set(handles.DATA_f,'String','1/298.3');%扁率
case 6%IUGG1975椭球
set(handles.DATA_a,'String',num2str(6378140.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257');%扁率
end
% UIWAIT makes GeodesyBasicComputing wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GeodesyBasicComputing_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in Import.
function Import_Callback(hObject, eventdata, handles)
% hObject handle to Import (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile('*.dat;*.txt', '选择文件');
if filename==0
msgbox('操作已取消');
return;
end
switch findobj(get(handles.Fselect_XYorBL,'selectedobject'))
case handles.Fomer_XY
% disp("Fomer_XY");
%%%%%%%%%%%%%%%以下代码均是针对高斯反算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
set(handles.XYDATA,'Data',[]);
XYDATA=table2array(readtable(filename));
set(handles.XYDATA,'Data',XYDATA);
% LError=errordlg('请输入坐标所处的中央子午线经度','提示');
% set(findall(allchild(LError),'style','pushbutton'),'string','确定');
% set(findall(get(LError,'children'),'type','text'),'fontsize',10,'fontname','隶书');
%设置输入中央子午线经度的弹窗
L0Prompt = {'输入坐标所在的中央子午线经度L0:'};
dlgtitle = '参数';
dims = [1 35];
definput = {'',''};
answer = inputdlg(L0Prompt,dlgtitle,dims,definput);
if isempty(answer)==1
InputNegative=errordlg('未输入中央子午线经度L0','输入取消');
set(findall(allchild(InputNegative),'style','pushbutton'),'string','确定');
set(findall(get(InputNegative,'children'),'type','text'),'fontsize',15,'fontname','隶书');
return;
else
L0=str2num(answer{1});
end
set(handles.Meridian,'String',num2str(L0));%设置转换前坐标所在的中央子午线经度
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));%默认与转换前保持一致,设置转换后坐标所在的中央子午线经度
%%%%%%%%%%%%%%%以上代码均是针对高斯反算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
return;%对handles.Fomer_XY的文件导入完成
case handles.Fomer_BL
% disp("Fomer_BL");
%%%%%%%%%%%%%%%以下代码均是针对高斯正算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
set(handles.BLDATA,'Data',[]);
BLdata=table2array(readtable(filename));
if get(handles.SixDegreeBand,'value')==1
% L=dfm_du(BLdata(1,3));
L=BLdata(1,3);
L0=6*(fix(L/6)+1)-3;%6度带中央经度
set(handles.Meridian,'String',num2str(L0));
% set(handles.After_Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
else get(handles.ThirdDegreeBand,'value')==1
L=dfm_du(BLdata(1,3));
L0=fix((L+1.5)/3)*3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
end
set(handles.BLDATA,'Data',BLdata);
%%%%%%%%%%%%%%%以上代码均是针对高斯正算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
return;%对handles.Fomer_BL的文件导入完成
end
% --- Executes on button press in Clear.
function Clear_Callback(hObject, eventdata, handles)
% hObject handle to Clear (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% set(findobj('style','edit'),'String','');%清空所有edit控件数据
clear_button=questdlg('确定清空数据吗?','数据清空','Yes','No','Yes');%内容,标题,选项(2个),默认选项
if strcmp(clear_button,'Yes')
%Yes,清空
set(findobj('Tag','Meridian'),'String','');%清空中央子午线数据
set(findobj('Tag','After_Meridian'),'String','');
%清空大地坐标表格中的数据
clear_BLdata=cell(4,3);
set(findobj('Tag','BLDATA'),'Data',clear_BLdata);
%清空平面坐标表格中的数据
clear_XYdata=cell(4,3);
set(findobj('Tag','XYDATA'),'Data',clear_XYdata);
end
% --- Executes on button press in Turn.
function Turn_Callback(hObject, eventdata, handles)
% hObject handle to Turn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% switch findobj(get(handles.select_3or6,'selectedobject'))
% case handles.ThirdDegreeBand&&handles.SixDegreeBand
% %定义一个错误对话框
% BandError=errordlg('不可同时选择两种带号','带号错误');
% set(findall(allchild(BandError),'style','pushbutton'),'string','确定');
% set(findall(get(BandError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
% case handles.ThirdDegreeBand||handles.SixDegreeBand
% %定义一个错误对话框
% BandError=errordlg('有且只能选择一种带号','带号错误');
% set(findall(allchild(BandError),'style','pushbutton'),'string','确定');
% set(findall(get(BandError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
% end
%引入自定义椭球参数
global diy_a;
global diy_b;
switch findobj(get(handles.Fselect_XYorBL,'selectedobject'))
case handles.Fomer_BL
set(handles.After_XY,'Value',1);
%%%%%%%高斯正算的相关操作%%%%%%%%%
BLdata=get(handles.BLDATA,'Data');
class(BLdata);%判断数组的类型
%导入的数据均为double型数组
if isfloat(BLdata)
if isempty(get(handles.BLDATA,'Data'))
BLDATAError=errordlg('请输\导入待处理数据','错误');
set(findall(allchild(BLDATAError),'style','pushbutton'),'string','确定');
set(findall(get(BLDATAError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
end
end
%输入的数据均为cell型数组
if iscell(BLdata)
if isempty(cell2mat(get(handles.BLDATA,'Data')))
%定义一个错误对话框去判断大地坐标是否为空
BLDATAError=errordlg('请输\导入待处理数据','错误');
set(findall(allchild(BLDATAError),'style','pushbutton'),'string','确定');
set(findall(get(BLDATAError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
end
end
%带号选择判断
if get(handles.ThirdDegreeBand,'value')==1&&get(handles.SixDegreeBand,'value')==1
%定义一个错误对话框
BandError=errordlg('不可同时选择两种带号','带号错误');
set(findall(allchild(BandError),'style','pushbutton'),'string','确定');
set(findall(get(BandError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
elseif get(handles.ThirdDegreeBand,'value')==0&&get(handles.SixDegreeBand,'value')==0
BandError=errordlg('有且只能选择一种带号','带号错误');
set(findall(allchild(BandError),'style','pushbutton'),'string','确定');
set(findall(get(BandError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
end
%以下进行导入数据的类型分析,以便进行数据类型的转化
%正算数据格式化处理
if class(BLdata)=="double"
% disp("在此处设置double型BLdata的处理");
PotName=BLdata(:,1);
BLdata=BLdata(:,2:3);
elseif class(BLdata)=="cell"
% disp("在此处设置cell型BLdata的处理");
PotName_input=BLdata(:,1);
BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
PotName=BLdata(:,1);
BLdata=BLdata(:,2:3);
if get(handles.ThirdDegreeBand,'Value')==1
L=dfm_du(BLdata(1,2));
L0=fix((L+1.5)/3)*3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
elseif get(handles.SixDegreeBand,'Value')==1
L=BLdata(1,2);
L0=6*(fix(L/6)+1)-3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
end
end
switch(get(handles.Ellipsoid,'value'))
case 1%北京54椭球
a=6378245.0;
b=6356863.0187730473;
case 2%西安80椭球
a=6378140.0;
b=6356755.2881575287;
case 3%CGCS2000椭球
a=6378137.0;
b=6356752.3141;%扁率
case 4%WGS84椭球
a=6378137.0;
b=6356752.3142;%扁率
case 5%克拉索夫斯基椭球
a=6378245.0;%长半轴
b=6356863.0187730473;%扁率
case 6%IUGG1975椭球
a=6378140.0;
b=6356755.2881575287;%扁率
case 7%自定义椭球
a=diy_a;
b=diy_b;
end
if get(handles.SixDegreeBand,'Value')==1
i=1;
%定义一个用于存放正算结果的空矩阵
Result_GaussPositiveFormula=zeros(size(get(handles.BLDATA,'Data')))*nan;
class(PotName);
while i<=size(BLdata,1)
[x,y] = GaussPositiveFormula(a,b,BLdata(i,1),BLdata(i,2));
Result_GaussPositiveFormula(i,:)=[PotName(i),x,y];
i=i+1;
end
elseif get(handles.ThirdDegreeBand,'Value')==1
i=1;
%定义一个用于存放正算结果的空矩阵
Result_GaussPositiveFormula=zeros(size(get(handles.BLDATA,'Data')))*nan;
class(PotName);
while i<=size(BLdata,1)
[x,y] = GaussPositiveFormula_3(a,b,BLdata(i,1),BLdata(i,2));
Result_GaussPositiveFormula(i,:)=[PotName(i),x,y];
i=i+1;
end
end
PotName_str=num2str(PotName);
PotName_cell=cellstr(PotName_str);
% num2str(Result_GaussPositiveFormula(:,2),16)16为小数点位数
Formerx0=str2num(get(handles.FormerX0,'String'))*1000;
Result_GaussPositiveFormula_x=Result_GaussPositiveFormula(:,2)+Formerx0;
Result_GaussPositiveFormula_x_cell=cellstr(num2str(Result_GaussPositiveFormula_x,16));
Formery0=str2num(get(handles.FormerY0,'String'))*1000;
Result_GaussPositiveFormula_y=Result_GaussPositiveFormula(:,3)+Formery0;
Result_GaussPositiveFormula_y_cell=cellstr(num2str(Result_GaussPositiveFormula_y,16));
Result_GaussPositiveFormula_x0=cellstr(num2str(Result_GaussPositiveFormula(:,2),16));%未加常数的x
Result_GaussPositiveFormula_y0=cellstr(num2str(Result_GaussPositiveFormula(:,3),16));%未加常数的y
if size(PotName,1)==1
PotName_cell={PotName;'NaN';'NaN';'NaN'};
elseif size(PotName,1)==2
PotName_cell={PotName(1);PotName(2);'NaN';'NaN'};
elseif size(PotName,1)==3
PotName_cell={PotName(1);PotName(2);PotName(3);'NaN'};
elseif size(PotName,1)==4
PotName_cell={PotName(1);PotName(2);PotName(3);PotName(4)};
end
set(handles.XYDATA,'Data',[PotName_cell,Result_GaussPositiveFormula_x_cell,Result_GaussPositiveFormula_y_cell]);
% [x,y] = GaussPositiveFormula(a,b,B,L)
%%%%%%%高斯正算的相关操作%%%%%%%%%
case handles.Fomer_XY
set(handles.After_BL,'Value',1);
%%%%%%%高斯反算的相关操作%%%%%%%%%
XYdata=get(handles.XYDATA,'Data');
class(XYdata);%判断数组的类型
%导入的数据均为douXYe型数组
if isfloat(XYdata)
if isempty(get(handles.XYDATA,'Data'))
XYDATAError=errordlg('请输\导入待处理数据','错误');
set(findall(allchild(XYDATAError),'style','pushbutton'),'string','确定');
set(findall(get(XYDATAError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
end
end
%输入的数据均为cell型数组
if iscell(XYdata)
if isempty(cell2mat(get(handles.XYDATA,'Data')))
%定义一个错误对话框去判断大地坐标是否为空
XYDATAError=errordlg('请输\导入待处理数据','错误');
set(findall(allchild(XYDATAError),'style','pushbutton'),'string','确定');
set(findall(get(XYDATAError,'children'),'type','text'),'fontsize',15,'fontname','隶书');
end
end
%反算数据格式化处理
if class(XYdata)=="double"
% disp("在此处设置douXYe型XYdata的处理");
PotName=XYdata(:,1);
XYdata=XYdata(:,2:3);
Formerx0=str2num(get(handles.FormerX0,'String'))*1000;
Formery0=str2num(get(handles.FormerY0,'String'))*1000;
XYdata_x=XYdata(:,1)-Formerx0;
XYdata_y=XYdata(:,2)-Formery0;
XYdata=[XYdata_x,XYdata_y];
elseif class(XYdata)=="cell"
% disp("在此处设置cell型XYdata的处理");
PotName_input=XYdata(:,1);
XYdata=cell2mat(XYdata);%将元胞数组转化为可进行数值计算的矩阵
PotName=XYdata(:,1);
XYdata=XYdata(:,2:3);
Formerx0=str2num(get(handles.FormerX0,'String'))*1000;
Formery0=str2num(get(handles.FormerY0,'String'))*1000;
XYdata_x=XYdata(:,1)-Formerx0;
XYdata_y=XYdata(:,2)-Formery0;
XYdata=[XYdata_x,XYdata_y];
end
switch(get(handles.Ellipsoid,'value'))
case 1%北京54椭球
a=6378245.0;
b=6356863.0187730473;
case 2%西安80椭球
a=6378140.0;
b=6356755.2881575287;
case 3%CGCS2000椭球
a=6378137.0;
b=6356752.3141;%扁率
case 4%WGS84椭球
a=6378137.0;
b=6356752.3142;%扁率
case 5%克拉索夫斯基椭球
a=6378245.0;%长半轴
b=6356863.0187730473;%扁率
case 6%IUGG1975椭球
a=6378140.0;
b=6356755.2881575287;%扁率
case 7%自定义椭球
a=diy_a;
b=diy_b;
end
i=1;
%定义一个用于存放反算结果的空矩阵
Result_GaussNegativeFormula=zeros(size(get(handles.XYDATA,'Data')))*nan;
class(PotName);
while i<=size(XYdata,1)
[B,l] = GaussNegativeFormula(a,b,XYdata(i,1),XYdata(i,2));
Result_GaussNegativeFormula(i,:)=[PotName(i),B,l];
i=i+1;
end
PotName_str=num2str(PotName);
PotName_cell=cellstr(PotName_str);
if size(PotName,1)==1
PotName_cell={PotName;'NaN';'NaN';'NaN'};
elseif size(PotName,1)==2
PotName_cell={PotName(1);PotName(2);'NaN';'NaN'};
elseif size(PotName,1)==3
PotName_cell={PotName(1);PotName(2);PotName(3);'NaN'};
elseif size(PotName,1)==4
PotName_cell={PotName(1);PotName(2);PotName(3);PotName(4)};
end
Result_GaussNegativeFormula_B=Result_GaussNegativeFormula(:,2);
i=1;
while i<=size(Result_GaussNegativeFormula_B,1)
Result_GaussNegativeFormula_B_1(i,1)=cellstr(rad_angle(Result_GaussNegativeFormula_B(i)));
i=i+1;
end
Result_GaussNegativeFormula_B_cell=Result_GaussNegativeFormula_B_1;
% Result_GaussNegativeFormula_B_cell=cellstr(num2str(Result_GaussNegativeFormula_B,16))
Result_GaussNegativeFormula_l=Result_GaussNegativeFormula(:,3);
L0=get(handles.Meridian,'String');
L0=str2num(L0);
L0=angle_rad(L0);
o=1;
Result_GaussNegativeFormula_L=L0+Result_GaussNegativeFormula_l;
while o<=size(Result_GaussNegativeFormula_L,1)
Result_GaussNegativeFormula_L_1(o,1)=cellstr(rad_angle(Result_GaussNegativeFormula_L(o)));
o=o+1;
end
Result_GaussNegativeFormula_L_cell=Result_GaussNegativeFormula_L_1;
% Result_GaussNegativeFormula_L_cell=cellstr(num2str(Result_GaussNegativeFormula_L,16));
set(handles.BLDATA,'Data',[PotName_cell,Result_GaussNegativeFormula_B_cell,Result_GaussNegativeFormula_L_cell]);
%%%%%%%%%%%%%%%%%%%%%%%%%%
end
% --- Executes on button press in Save.
function Save_Callback(hObject, eventdata, handles)
% hObject handle to Save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Savebutton=questdlg('选择导出数据的格式:','数据导出','Excle格式','文本格式','文本格式');
switch findobj(get(handles.Fselect_XYorBL,'selectedobject'))
case handles.Fomer_BL
if strcmp(Savebutton,'文本格式')
[filename pathname]=uiputfile({'*.txt'},'保存','xy_myfile');
%%%%将元胞数组输出到文本文件
str=strcat(pathname,filename);
data=get(handles.XYDATA,'Data');
fin=fopen(str,'wt');
if isequal(filename,0) || isequal(pathname,0)
return;
else
for ii=1:size(data,1)
fprintf(fin,'%s\n',data{ii,:});
end
fclose(fin);
end
basicwaitbar;%进度条
elseif strcmp(Savebutton,'Excle格式')
[filename pathname]=uiputfile({'*.xlsx'},'保存','xy_myfile');
xlswrite(filename,get(handles.XYDATA,'Data'));
basicwaitbar;%进度条
end
case handles.Fomer_XY
if strcmp(Savebutton,'文本格式')
[filename pathname]=uiputfile({'*.txt'},'保存','BL_myfile');
%%%%将元胞数组输出到文本文件
str=strcat(pathname,filename);
data=get(handles.BLDATA,'Data');
fin=fopen(str,'wt');
if isequal(filename,0) || isequal(pathname,0)
return;
else
for ii=1:size(data,1)
fprintf(fin,'%s\n',data{ii,:});
end
fclose(fin);
end
basicwaitbar;%进度条
elseif strcmp(Savebutton,'Excle格式')
[filename pathname]=uiputfile({'*.xlsx'},'保存','BL_myfile');
xlswrite(filename,get(handles.BLDATA,'Data'));
end
basicwaitbar;%进度条
end
% --- Executes on button press in Exit.
function Exit_Callback(hObject, eventdata, handles)
% hObject handle to Exit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Exitbutton=questdlg('确定退出吗?','退出程序','Yes','No','Yes');%内容,标题,选项(2个),默认选项
if strcmp(Exitbutton,'Yes')
delete(hObject);%Yes,关闭程序界面
close;
end
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
% --- Executes on selection change in Ellipsoid.
function Ellipsoid_Callback(hObject, eventdata, handles)
% hObject handle to Ellipsoid (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns Ellipsoid contents as cell array
% contents{get(hObject,'Value')} returns selected item from Ellipsoid
guidata(hObject, handles);
get(handles.Ellipsoid,'value');%获取选择的参考椭球
global diy_a;
global diy_b;
switch(get(handles.Ellipsoid,'value'))
case 1%北京54椭球
set(handles.DATA_a,'String',num2str(6378245.0,'%.10f'));%长半轴
set(handles.DATA_f,'String','1/298.3');%扁率
case 2%西安80椭球
set(handles.DATA_a,'String',num2str(6378140.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257');%扁率
case 3%CGCS2000椭球
set(handles.DATA_a,'String',num2str(6378137.0,'%.10f'));
set(handles.DATA_f,'String','1/298.25722210100');%扁率
case 4%WGS84椭球
set(handles.DATA_a,'String',num2str(6378137.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257223563');%扁率
case 5%克拉索夫斯基椭球
set(handles.DATA_a,'String',num2str(6378245.0,'%.10f'));%长半轴
set(handles.DATA_f,'String','1/298.3');%扁率
case 6%IUGG1975椭球
set(handles.DATA_a,'String',num2str(6378140.0,'%.10f'));
set(handles.DATA_f,'String','1/298.257');%扁率
case 7%其他椭球
%输入椭球参数
EllipsoidPrompt = {'输入长半轴a:','输入短半轴b:'};
dlgtitle = '参数';
dims = [1 35];
definput = {'',''};
answer = inputdlg(EllipsoidPrompt,dlgtitle,dims,definput);
if isempty(answer)==1
InputNegative=errordlg('未输入任何椭球参数','输入取消');
set(findall(allchild(InputNegative),'style','pushbutton'),'string','确定');
set(findall(get(InputNegative,'children'),'type','text'),'fontsize',15,'fontname','隶书');
return;
else
diy_a=str2num(answer{1});
diy_b=str2num(answer{2});
end
Data_f=(diy_a-diy_b)/diy_a;
set(handles.DATA_a,'String',answer(1));
set(handles.DATA_f,'String',num2str(Data_f));
end
% --- Executes during object creation, after setting all properties.
function Ellipsoid_CreateFcn(hObject, eventdata, handles)
% hObject handle to Ellipsoid (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function DATA_a_Callback(hObject, eventdata, handles)
% hObject handle to DATA_a (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of DATA_a as text
% str2double(get(hObject,'String')) returns contents of DATA_a as a double
% --- Executes during object creation, after setting all properties.
function DATA_a_CreateFcn(hObject, eventdata, handles)
% hObject handle to DATA_a (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function DATA_f_Callback(hObject, eventdata, handles)
% hObject handle to DATA_f (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of DATA_f as text
% str2double(get(hObject,'String')) returns contents of DATA_f as a double
% --- Executes during object creation, after setting all properties.
function DATA_f_CreateFcn(hObject, eventdata, handles)
% hObject handle to DATA_f (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes during object deletion, before destroying properties.
function BLDATA_DeleteFcn(hObject, eventdata, handles)
% hObject handle to BLDATA (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function After_Meridian_Callback(hObject, eventdata, handles)
% hObject handle to After_Meridian (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of After_Meridian as text
% str2double(get(hObject,'String')) returns contents of After_Meridian as a double
% --- Executes during object creation, after setting all properties.
function After_Meridian_CreateFcn(hObject, eventdata, handles)
% hObject handle to After_Meridian (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function AfterX0_Callback(hObject, eventdata, handles)
% hObject handle to AfterX0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of AfterX0 as text
% str2double(get(hObject,'String')) returns contents of AfterX0 as a double
% --- Executes during object creation, after setting all properties.
function AfterX0_CreateFcn(hObject, eventdata, handles)
% hObject handle to AfterX0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function AfterY0_Callback(hObject, eventdata, handles)
% hObject handle to AfterY0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of AfterY0 as text
% str2double(get(hObject,'String')) returns contents of AfterY0 as a double
% --- Executes during object creation, after setting all properties.
function AfterY0_CreateFcn(hObject, eventdata, handles)
% hObject handle to AfterY0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Meridian_Callback(hObject, eventdata, handles)
% hObject handle to Meridian (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Meridian as text
% str2double(get(hObject,'String')) returns contents of Meridian as a double
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
% --- Executes during object creation, after setting all properties.
function Meridian_CreateFcn(hObject, eventdata, handles)
% hObject handle to Meridian (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function FormerX0_Callback(hObject, eventdata, handles)
% hObject handle to FormerX0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of FormerX0 as text
% str2double(get(hObject,'String')) returns contents of FormerX0 as a double
set(handles.AfterX0,'String',get(handles.FormerX0,'String'));%默认与转换前保持一致,%设置转换前坐标加常数x0
% --- Executes during object creation, after setting all properties.
function FormerX0_CreateFcn(hObject, eventdata, handles)
% hObject handle to FormerX0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function FormerY0_Callback(hObject, eventdata, handles)
% hObject handle to FormerY0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of FormerY0 as text
% str2double(get(hObject,'String')) returns contents of FormerY0 as a double
set(handles.AfterY0,'String',get(handles.FormerY0,'String'));%默认与转换前保持一致,%设置转换前坐标加常数y0
% --- Executes during object creation, after setting all properties.
function FormerY0_CreateFcn(hObject, eventdata, handles)
% hObject handle to FormerY0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in ThirdDegreeBand.
function ThirdDegreeBand_Callback(hObject, eventdata, handles)
% hObject handle to ThirdDegreeBand (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of ThirdDegreeBand
BLdata=get(handles.BLDATA,'Data');
class(BLdata);
% BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
% if class(BLdata)==cell
% BLdata=cell2mat(BLdata);
% else
% return;
% end
switch class(BLdata)
case 'cell'
BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
otherwise
BLdata_wuyong=BLdata;
end
BLdata=BLdata(:,2:3);
L=dfm_du(BLdata(1,2));
L0=fix((L+1.5)/3)*3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
% --- Executes on button press in SixDegreeBand.
function SixDegreeBand_Callback(hObject, eventdata, handles)
% hObject handle to SixDegreeBand (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of SixDegreeBand
BLdata=get(handles.BLDATA,'Data');
class(BLdata);
switch class(BLdata)
case 'cell'
BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
otherwise
BLdata_wuyong=BLdata;
end
% BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
% if class(BLdata)==cell
% BLdata=cell2mat(BLdata);
% else
% return;
% end
BLdata=BLdata(:,2:3);
L=BLdata(1,2);
L0=6*(fix(L/6)+1)-3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
% --- Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function Fselect_XYorBL_CreateFcn(hObject, eventdata, handles)
% hObject handle to Fselect_XYorBL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
function select_3or6_CreateFcn(hObject, eventdata, handles)
% hObject handle to Fselect_XYorBL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes on key press with focus on Meridian and none of its controls.
function Meridian_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to Meridian (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.UICONTROL)
% Key: name of the key that was pressed, in lower case
% Character: character interpretation of the key(s) that was pressed
% Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles structure with handles and user data (see GUIDATA)
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
% --- Executes when entered data in editable cell(s) in BLDATA.
function BLDATA_CellEditCallback(hObject, eventdata, handles)
% hObject handle to BLDATA (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
% Indices: row and column indices of the cell(s) edited
% PreviousData: previous data for the cell(s) edited
% EditData: string(s) entered by the user
% NewData: EditData or its converted form set on the Data property. Empty if Data was not changed
% Error: error string when failed to convert EditData to appropriate value for Data
% handles structure with handles and user data (see GUIDATA)
BLdata=get(handles.BLDATA,'Data');
BLdata=cell2mat(BLdata);%将元胞数组转化为可进行数值计算的矩阵
BLdata=BLdata(:,2:3);
if get(handles.ThirdDegreeBand,'Value')==1
L=dfm_du(BLdata(1,2));
L0=fix((L+1.5)/3)*3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
elseif get(handles.SixDegreeBand,'Value')==1
L=BLdata(1,2);
L0=6*(fix(L/6)+1)-3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
end
% --- Executes on button press in Fomer_BL.
function Fomer_BL_Callback(hObject, eventdata, handles)
% hObject handle to Fomer_BL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Fomer_BL
set(handles.After_XY,'Value',1);
% --- Executes on button press in Fomer_XY.
function Fomer_XY_Callback(hObject, eventdata, handles)
% hObject handle to Fomer_XY (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Fomer_XY
set(handles.After_BL,'Value',1);
% --------------------------------------------------------------------
function import_s_ClickedCallback(hObject, eventdata, handles)
% hObject handle to import_s (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile('*.dat;*.txt', '选择文件');
if filename==0
msgbox('操作已取消');
return;
end
switch findobj(get(handles.Fselect_XYorBL,'selectedobject'))
case handles.Fomer_XY
% disp("Fomer_XY");
%%%%%%%%%%%%%%%以下代码均是针对高斯反算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
set(handles.XYDATA,'Data',[]);
XYDATA=table2array(readtable(filename));
set(handles.XYDATA,'Data',XYDATA);
% LError=errordlg('请输入坐标所处的中央子午线经度','提示');
% set(findall(allchild(LError),'style','pushbutton'),'string','确定');
% set(findall(get(LError,'children'),'type','text'),'fontsize',10,'fontname','隶书');
%设置输入中央子午线经度的弹窗
L0Prompt = {'输入坐标所在的中央子午线经度L0:'};
dlgtitle = '参数';
dims = [1 35];
definput = {'',''};
answer = inputdlg(L0Prompt,dlgtitle,dims,definput);
if isempty(answer)==1
InputNegative=errordlg('未输入中央子午线经度L0','输入取消');
set(findall(allchild(InputNegative),'style','pushbutton'),'string','确定');
set(findall(get(InputNegative,'children'),'type','text'),'fontsize',15,'fontname','隶书');
return;
else
L0=str2num(answer{1});
end
set(handles.Meridian,'String',num2str(L0));%设置转换前坐标所在的中央子午线经度
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));%默认与转换前保持一致,设置转换后坐标所在的中央子午线经度
%%%%%%%%%%%%%%%以上代码均是针对高斯反算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
return;%对handles.Fomer_XY的文件导入完成
case handles.Fomer_BL
% disp("Fomer_BL");
%%%%%%%%%%%%%%%以下代码均是针对高斯正算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
set(handles.BLDATA,'Data',[]);
BLdata=table2array(readtable(filename));
if get(handles.SixDegreeBand,'value')==1
% L=dfm_du(BLdata(1,3));
L=BLdata(1,3);
L0=6*(fix(L/6)+1)-3;%6度带中央经度
set(handles.Meridian,'String',num2str(L0));
% set(handles.After_Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
else get(handles.ThirdDegreeBand,'value')==1
L=dfm_du(BLdata(1,3));
L0=fix((L+1.5)/3)*3;
set(handles.Meridian,'String',num2str(L0));
set(handles.After_Meridian,'String',get(handles.Meridian,'String'));
end
set(handles.BLDATA,'Data',BLdata);
%%%%%%%%%%%%%%%以上代码均是针对高斯正算而进行的数据文件导入的工作%%%%%%%%%%%%%%%%%
return;%对handles.Fomer_BL的文件导入完成
end
% --------------------------------------------------------------------
function save_s_ClickedCallback(hObject, eventdata, handles)
% hObject handle to save_s (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Savebutton=questdlg('选择导出数据的格式:','数据导出','Excle格式','文本格式','文本格式');
switch findobj(get(handles.Fselect_XYorBL,'selectedobject'))
case handles.Fomer_BL
if strcmp(Savebutton,'文本格式')
[filename pathname]=uiputfile({'*.txt'},'保存','xy_myfile');
%%%%将元胞数组输出到文本文件
str=strcat(pathname,filename);
data=get(handles.XYDATA,'Data');
fin=fopen(str,'wt');
if isequal(filename,0) || isequal(pathname,0)
return;
else
for ii=1:size(data,1)
fprintf(fin,'%s\n',data{ii,:});
end
fclose(fin);
end
elseif strcmp(Savebutton,'Excle格式')
[filename pathname]=uiputfile({'*.xlsx'},'保存','xy_myfile');
xlswrite(filename,get(handles.XYDATA,'Data'));
end
case handles.Fomer_XY
if strcmp(Savebutton,'文本格式')
[filename pathname]=uiputfile({'*.txt'},'保存','BL_myfile');
%%%%将元胞数组输出到文本文件
str=strcat(pathname,filename);
data=get(handles.BLDATA,'Data');