Changeset 1157 for trunk/src/get_field.m
- Timestamp:
- Jul 11, 2024, 4:13:03 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r1127 r1157 509 509 VarIndex=find(strcmp(VarName,Field.Display.ListVarName),1); 510 510 DimCell=Field.Display.VarDimName{VarIndex}; 511 % y_index=get(handles.Coord_y,'Value'); 512 % y_menu=get(handles.Coord_y,'String'); 513 % if isempty(y_menu) 514 % return 515 % else 516 % YName=y_menu{y_index}; 517 % end 511 518 512 519 513 %% set list of possible coordinates 520 % test_component=zeros(size(Field.Display.VarDimName));%=1 when variable #ilist is eligible as unstructured coordinate 514 521 515 test_coord=zeros(size(Field.Display.VarDimName)); %=1 when variable #ilist is eligible as structured coordiante 522 % ListCoord={''};523 % dim_var=Field.Display.VarDimName{y_index};%list of dimensions of the selected variable524 516 525 517 for ilist=1:numel(Field.Display.VarDimName) 526 dimnames=Field.Display.VarDimName{ilist}; %list of dimensions for variable #ilist 527 if isequal(dimnames,DimCell)||isequal(dimnames(1:end-1),DimCell)||isequal(dimnames(2:end),DimCell) 528 test_coord(ilist)=1; 529 end 530 end 531 ListCoord=Field.Display.ListVarName(find(test_coord)); 518 %dimnames=Field.Display.VarDimName{ilist}; %list of dimensions for variable #ilist 519 % if isequal(dimnames,DimCell)||isequal(dimnames(1:end-1),DimCell)||isequal(dimnames(2:end),DimCell) 520 % if numel(dimnames)==1 || 521 % test_coord(ilist)=1; 522 % end 523 end 524 ListCoord=Field.Display.ListVarName;%(find(test_coord)); 532 525 set(handles.Coord_y,'String',ListCoord) 533 526 val_y=1; … … 984 977 %----------------------------------------------------------------------- 985 978 Field=get(handles.get_field,'UserData'); 986 index=name2index(VarName,Field.ListVarName); 979 index=name2index(VarName,Field.ListVarName); %index of the selectd variable 987 980 if ~isempty(index) 988 set(handles.variables,'Value',index+1) 981 set(handles.variables,'Value',index+1) %indicate which variable is selected in the list (+1 because of the '*' display) 989 982 variables_Callback(handles.variables, VarName, handles) 990 983 end
Note: See TracChangeset
for help on using the changeset viewer.