Changeset 1095 for trunk/src/get_field.m
- Timestamp:
- Mar 31, 2021, 3:32:03 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r1093 r1095 79 79 if ischar(filename) % input file name 80 80 set(handles.inputfile,'String',filename)% fill the input file name 81 if ~isempty(regexp(filename,'.mat$'))%case of .mat file 82 Field=mat2struct(filename); 83 errormsg=''; 84 else 81 85 [Field,tild,tild,errormsg]=nc2struct(filename,[]);% reads the field structure, without the variables 86 end 82 87 else 83 88 msgbox_uvmat('ERROR','get_field requires a file name as input')% display error message for input file reading … … 405 410 case '1D plot' 406 411 set(handles.Coordinates,'Visible','on') 407 %set(handles.PanelOrdinate,'Visible','on')408 %pos=get(handles.PanelOrdinate,'Position');409 % pos(1)=2;410 % pos_coord=get(handles.Coordinates,'Position');411 % pos(2)=pos_coord(2)-pos(4)-2;412 %set(handles.PanelOrdinate,'Position',pos)413 412 set(handles.PanelScalar,'Visible','off') 414 413 set(handles.PanelVectors,'Visible','off') … … 419 418 set(handles.Z_title,'Visible','off') 420 419 set(handles.Coord_x,'String',Field.Display.ListVarName') 421 Coord_x_Callback(hObject, VarName, handles) 422 %set(handles.Coord_y,'String',Field.Display.ListVarName') 423 %Coord_x_Callback(hObject, VarName, handles) 420 Coord_x_Callback(hObject, VarName, handles) 424 421 case {'scalar'} 425 422 set(handles.Coordinates,'Visible','on') 426 %set(handles.PanelOrdinate,'Visible','off')427 423 set(handles.PanelScalar,'Visible','on') 428 424 set(handles.PanelVectors,'Visible','off') … … 469 465 set(handles.Coord_y,'Visible','on') 470 466 set(handles.Y_title,'Visible','on') 467 set(handles.Coord_x,'Visible','on') 471 468 %default vector selection 472 469 vector_x_value=get(handles.vector_x,'UserData'); … … 770 767 update_field(handles,VarName) 771 768 end 769 772 770 %------------------------------------------------------------------------ 773 771 % --- Executes on selection change in vector_x or vector_y … … 803 801 var_coord=find(test_coord);% % list of variable indices elligible as structured coordinates 804 802 var_component(var_component==vector_x_index|var_component==vector_y_index)=[]; 805 var_coord(var_coord==vector_x_index|var_coord==vector_y_index)=[];% remove vector components f orm te possible list of coordinates803 var_coord(var_coord==vector_x_index|var_coord==vector_y_index)=[];% remove vector components from the possible list of coordinates 806 804 ListCoord=Field.Display.ListVarName([var_coord var_component]); 807 805 … … 844 842 coord_val=[1 2 3]; 845 843 end 846 set(handles.Coord_x,'Value', coord_val(end))847 set(handles.Coord_y,'Value', coord_val(end-1))844 set(handles.Coord_x,'Value',min(coord_val(end),numel(ListCoord))) 845 set(handles.Coord_y,'Value',min(coord_val(end-1),numel(ListCoord))) 848 846 if numel(coord_val)>=3 849 847 set(handles.Coord_z,'Value',coord_val(end-2)) … … 887 885 %------------------------------------------------------------------------ 888 886 function Coord_x_Callback(hObject, DimCell, handles) 889 DimCell 887 890 888 index=get(handles.Coord_x,'Value'); 891 889 string=get(handles.Coord_x,'String');
Note: See TracChangeset
for help on using the changeset viewer.