Changeset 399
- Timestamp:
- Apr 27, 2012, 12:28:47 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field.m
r397 r399 1 1 %'calc_field': defines fields (velocity, vort, div...) from civx data and calculate them 2 2 %--------------------------------------------------------------------- 3 % [DataOut,errormsg]=calc_field(Field Name,DataIn)3 % [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp) 4 4 % 5 5 % OUTPUT: … … 16 16 % 17 17 % INPUT: 18 % Field Name: string representing the name of the field18 % FieldList: cell array of strings representing the name(s) of the field(s) to calculate 19 19 % DataIn: structure representing the field, as defined in check_field_srtructure.m 20 % Coord_interp(:,nb_coord) optional set of coordinates to interpolate the field (use with thin plate shell) 20 21 % 21 22 % FUNCTION related … … 23 24 % file, depending on the scalar 24 25 25 function [DataOut,errormsg]=calc_field(Field Name,DataIn,Coord_interp)26 function [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp) 26 27 27 28 %list of defined scalars to display in menus (in addition to 'ima_cor'). … … 46 47 'error'}; %error associated to a vector (for stereo or patch) 47 48 errormsg=[]; %default error message 48 if ~exist('Field Name','var')49 if ~exist('FieldList','var') 49 50 DataOut=list_field;% gives the list of possible fields in the absence of input 50 51 else … … 52 53 DataIn=[]; 53 54 end 54 if ischar(Field Name)55 Field Name={FieldName};%convert a string input to a cell with one string element55 if ischar(FieldList) 56 FieldList={FieldList};%convert a string input to a cell with one string element 56 57 end 57 58 if isfield(DataIn,'Z')&& isequal(size(DataIn.Z),size(DataIn.X)) … … 78 79 XMin=min(min(DataIn.SubRange(1,:,:))); 79 80 YMin=min(min(DataIn.SubRange(2,:,:))); 80 % if ~exist('Coord_interp','var')81 % Mesh=sqrt((YMax-YMin)*(XMax-XMin)/numel(DataIn.Coord_tps(:,1,:)));%2D82 % xI=XMin:Mesh:XMax;83 % yI=YMin:Mesh:YMax;84 % [XI,YI]=meshgrid(xI,yI);% interpolation grid85 % Coord_interp(:,1)=reshape(XI,[],1);86 % Coord_interp(:,2)=reshape(YI,[],1);87 % DataOut.coord_y=[yI(1) yI(end)];88 % DataOut.coord_x=[xI(1) xI(end)];89 % end90 81 check_der=0; 91 82 check_val=0; 92 for ilist=1:length(FieldName) 93 switch FieldName{ilist} 83 nb_sites=size(Coord_interp,1); 84 nb_coord=size(Coord_interp,2); 85 for ilist=1:length(FieldList) 86 switch FieldList{ilist} 94 87 case 'velocity' 95 88 check_val=1; 96 DataOut.U=zeros( size(Coord_interp,1));97 DataOut.V=zeros( size(Coord_interp,1));89 DataOut.U=zeros(nb_sites,1); 90 DataOut.V=zeros(nb_sites,1); 98 91 case{'vort','div','strain'}% case of spatial derivatives 99 92 check_der=1; 100 DataOut.(Field Name{ilist})=zeros(size(Coord_interp,1));101 otherwise % case of a scalar102 check_val=1;103 DataOut.(FieldName{ilist})=zeros(size(Coord_interp,1));104 end 105 end 106 nbval=zeros( size(Coord_interp,1));93 DataOut.(FieldList{ilist})=zeros(nb_sites,1); 94 % otherwise % case of a scalar 95 % check_val=1; 96 % DataOut.(FieldList{ilist})=zeros(size(Coord_interp,1)); 97 end 98 end 99 nbval=zeros(nb_sites,1); 107 100 NbSubDomain=size(DataIn.SubRange,3); 101 %DataIn.Coord_tps=DataIn.Coord_tps(1:end-3,:,:);% suppress the 3 zeros used to fit with the dimensions of variables 108 102 for isub=1:NbSubDomain 109 if isfield(DataIn,'NbSites') 110 nbvec_sub=DataIn.NbSites(isub); 111 else 112 nbvec_sub=numel(find(DataIn.Indices_tps(:,isub))); 113 end 114 ind_sel=find(Coord_interp>=DataIn.SubRange(:,1,isub) & Coord_interp<=DataIn.SubRange(:,2,isub)); 103 nbvec_sub=DataIn.NbSites(isub); 104 check_range=(Coord_interp >=ones(nb_sites,1)*DataIn.SubRange(:,1,isub)' & Coord_interp<=ones(nb_sites,1)*DataIn.SubRange(:,2,isub)'); 105 ind_sel=find(sum(check_range,2)==nb_coord); 115 106 %rho smoothing parameter 116 107 % epoints = Coord_interp(ind_sel) ;% coordinates of interpolation sites … … 118 109 nbval(ind_sel)=nbval(ind_sel)+1;% records the number of values for eacn interpolation point (in case of subdomain overlap) 119 110 if check_val 120 EM = tps_eval(Coord_interp(ind_sel ),DataIn.Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the velocity from tps 'sources'111 EM = tps_eval(Coord_interp(ind_sel,:),DataIn.Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the velocity from tps 'sources' 121 112 end 122 113 if check_der 123 [EMDX,EMDY] = tps_eval_dxy(Coord_interp(ind_sel ),DataIn.Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the spatial derivatives from tps 'sources'124 end 125 for ilist=1:length(Field Name)126 switch Field Name{ilist}114 [EMDX,EMDY] = tps_eval_dxy(Coord_interp(ind_sel,:),DataIn.Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the spatial derivatives from tps 'sources' 115 end 116 for ilist=1:length(FieldList) 117 switch FieldList{ilist} 127 118 case 'velocity' 128 119 ListFields={'U', 'V'}; … … 154 145 end 155 146 DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang 156 DataOut.FF=reshape(DataOut.FF,numel(yI),numel(xI));147 % DataOut.FF=reshape(DataOut.FF,numel(yI),numel(xI)); 157 148 nbval(nbval==0)=1; 158 switch FieldName{1}159 case {'velocity','u','v'}160 DataOut.U=reshape(DataOut.U./nbval,numel(yI),numel(xI));161 DataOut.V=reshape(DataOut.V./nbval,numel(yI),numel(xI));162 case 'vort'163 DataOut.vort=reshape(DataOut.vort,numel(yI),numel(xI));164 case 'div'165 DataOut.div=reshape(DataOut.div,numel(yI),numel(xI));166 case 'strain'167 DataOut.strain=reshape(DataOut.strain,numel(yI),numel(xI));168 end149 % switch FieldList{1} 150 % case {'velocity','u','v'} 151 % DataOut.U=reshape(DataOut.U./nbval,numel(yI),numel(xI)); 152 % DataOut.V=reshape(DataOut.V./nbval,numel(yI),numel(xI)); 153 % case 'vort' 154 % DataOut.vort=reshape(DataOut.vort,numel(yI),numel(xI)); 155 % case 'div' 156 % DataOut.div=reshape(DataOut.div,numel(yI),numel(xI)); 157 % case 'strain' 158 % DataOut.strain=reshape(DataOut.strain,numel(yI),numel(xI)); 159 % end 169 160 DataOut.ListVarName=[DataOut.ListVarName ListFields]; 170 161 for ilist=3:numel(DataOut.ListVarName) … … 179 170 %% civx data 180 171 DataOut=DataIn; 181 for ilist=1:length(Field Name)182 if ~isempty(Field Name{ilist})183 [VarName,Value,Role,units]=feval(Field Name{ilist},DataIn);%calculate field with appropriate function named FieldName{ilist}172 for ilist=1:length(FieldList) 173 if ~isempty(FieldList{ilist}) 174 [VarName,Value,Role,units]=feval(FieldList{ilist},DataIn);%calculate field with appropriate function named FieldList{ilist} 184 175 ListVarName=[ListVarName VarName]; 185 176 ValueList=[ValueList Value]; -
trunk/src/civ.m
r398 r399 1239 1239 end 1240 1240 Param.Civ1.Time=((time(i2_civ1(ifile)+1,j2_civ1(j)+1)+time(i1_civ1(ifile)+1,j1_civ1(j)+1))/2); 1241 if strcmp(CivMode,'CivX') 1241 1242 Param.Civ1.term_a=num2stra(j1_civ1(j),nom_type_nc);%UTILITE? 1242 1243 Param.Civ1.term_b=num2stra(j2_civ1(j),nom_type_nc);% 1244 end 1243 1245 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1244 1246 if isempty(form) … … 1390 1392 end 1391 1393 Param.Civ2.Time=(time(i2_civ2(ifile)+1,j2_civ2(j)+1)+time(i1_civ2(ifile)+1,j1_civ2(j)+1))/2; 1394 if strcmp(CivMode,'CivX') 1392 1395 Param.Civ2.term_a=num2stra(j1_civ2(j),nom_type_nc); 1393 1396 Param.Civ2.term_b=num2stra(j2_civ2(j),nom_type_nc); 1397 end 1394 1398 Param.Civ2.filename_nc1=filecell.nc.civ1{ifile,j}; 1395 1399 Param.Civ2.filename_nc1(end-2:end)=[]; % remove '.nc' -
trunk/src/civ_matlab.m
r397 r399 108 108 Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ1_param];% {'Civ1_Time','Civ1_Dt'}]; 109 109 Data.ListVarName={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_F','Civ1_C'};% cell array containing the names of the fields to record 110 Data.VarDimName={' NbVec1','NbVec1','NbVec1','NbVec1','NbVec1','NbVec1'};110 Data.VarDimName={'nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1'}; 111 111 Data.VarAttribute{1}.Role='coord_x'; 112 112 Data.VarAttribute{2}.Role='coord_y'; … … 159 159 else 160 160 Data.ListVarName=[Data.ListVarName {'Civ1_FF'}]; 161 Data.VarDimName=[Data.VarDimName {' NbVec1'}];161 Data.VarDimName=[Data.VarDimName {'nb_vec_1'}]; 162 162 nbvar=length(Data.ListVarName); 163 163 Data.VarAttribute{nbvar}.Role='errorflag'; … … 179 179 nbvar=length(Data.ListVarName); 180 180 Data.ListVarName=[Data.ListVarName {'Civ1_U_smooth','Civ1_V_smooth','Civ1_SubRange','Civ1_NbSites','Civ1_Coord_tps','Civ1_U_tps','Civ1_V_tps'}]; 181 Data.VarDimName=[Data.VarDimName {'NbVec1','NbVec1',{'NbCoord','Two','NbSubDomain1'},{'NbSubDomain1'},...182 {' NbVec1Sub','NbCoord','NbSubDomain1'},{'Nbtps1','NbSubDomain1'},{'Nbtps1','NbSubDomain1'}}];181 Data.VarDimName=[Data.VarDimName {'nb_vec_1','nb_vec_1',{'nb_coord','nb_bounds','nb_subdomain_1'},{'nb_subdomain_1'},... 182 {'nb_tps_1','nb_coord','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'}}]; 183 183 Data.VarAttribute{nbvar+1}.Role='vector_x'; 184 184 Data.VarAttribute{nbvar+2}.Role='vector_y'; … … 195 195 [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=... 196 196 filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold); 197 % Data.Civ1_U_Diff(ind_good)=Data.Civ1_U(ind_good)-Ures; 198 % Data.Civ1_V_Diff(ind_good)=Data.Civ1_V(ind_good)-Vres;197 fill=zeros(3,2,size(Data.Civ1_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage) 198 Data.Civ1_Coord_tps=cat(1,Data.Civ1_Coord_tps,fill); 199 199 Data.Civ1_U_smooth(ind_good)=Ures; 200 200 Data.Civ1_V_smooth(ind_good)=Vres; … … 305 305 nbvar=numel(Data.ListVarName); 306 306 Data.ListVarName=[Data.ListVarName {'Civ2_X','Civ2_Y','Civ2_U','Civ2_V','Civ2_F','Civ2_C'}];% cell array containing the names of the fields to record 307 Data.VarDimName=[Data.VarDimName {' NbVec2','NbVec2','NbVec2','NbVec2','NbVec2','NbVec2'}];307 Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2'}]; 308 308 Data.VarAttribute{nbvar+1}.Role='coord_x'; 309 309 Data.VarAttribute{nbvar+2}.Role='coord_y'; … … 339 339 else 340 340 Data.ListVarName=[Data.ListVarName {'Civ2_FF'}]; 341 Data.VarDimName=[Data.VarDimName {' NbVec2'}];341 Data.VarDimName=[Data.VarDimName {'nb_vec_2'}]; 342 342 nbvar=length(Data.ListVarName); 343 343 Data.VarAttribute{nbvar}.Role='errorflag'; … … 356 356 nbvar=length(Data.ListVarName); 357 357 Data.ListVarName=[Data.ListVarName {'Civ2_U_smooth','Civ2_V_smooth','Civ2_SubRange','Civ2_NbSites','Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps'}]; 358 Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbCoord','Two','NbSubDomain2'},{'NbSubDomain2'},... 359 {'NbVec2Sub','NbCoord','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'}}]; 360 % Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}]; 361 % Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},... 362 % {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}]; 358 Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2',{'nb_coord','nb_bounds','nb_subdomain_2'},{'nb_subdomain_2'},... 359 {'nb_tps_2','nb_coord','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'}}]; 363 360 364 361 Data.VarAttribute{nbvar+1}.Role='vector_x'; … … 376 373 [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=... 377 374 filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold); 375 fill=zeros(3,2,size(Data.Civ2_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage) 376 Data.Civ2_Coord_tps=cat(1,Data.Civ2_Coord_tps,fill); 378 377 Data.Civ2_U_smooth(ind_good)=Ures; 379 378 Data.Civ2_V_smooth(ind_good)=Vres; -
trunk/src/find_field_indices.m
r397 r399 58 58 VarDimIndex=[]; 59 59 VarDimName={}; 60 61 60 if ~isfield(Data,'VarDimName') 62 61 errormsg='missing .VarDimName'; … … 64 63 end 65 64 66 % loop on the list of variables65 %% loop on the list of variables, group them by common dimensions 67 66 for ivar=1:nbvar 68 67 DimCell=Data.VarDimName{ivar}; %dimensions associated with the variable #ivar … … 85 84 CellVarIndex{icell}=ivar;%put the current variabl index in the new cell 86 85 end 87 86 88 87 %look for dimension variables 89 88 if numel(DimCell)==1% if the variable has a single dimension … … 100 99 end 101 100 102 % find the spatial dimensions and vector components101 %% find the spatial dimensions and vector components 103 102 ListRole={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','warnflag','errorflag',... 104 103 'ancillary','image','color','discrete','scalar','coord_tps'}; 104 NbDim=zeros(size(CellVarIndex));%default 105 105 for icell=1:length(CellVarIndex) 106 106 for ilist=1:numel(ListRole) … … 142 142 return 143 143 end 144 % if ivar_vector_x>1145 % ivar_vector_x=ivar_vector_x(1);146 % end147 % if ivar_vector_y>1148 % ivar_vector_y=ivar_vector_y(1);149 % end150 % if ivar_vector_z>1151 % ivar_vector_z=ivar_vector_z(1);152 % end153 144 if numel(ivar_errorflag)>1 154 145 errormsg='multiply defined error flag in the same cell'; … … 159 150 return 160 151 end 161 %NbDim(icell)=0;% nbre of space dimensions162 % NbDim(icell)=numel(DimCell);163 NbDim(icell)=0;164 152 test_coord=0; 165 153 if numel(VarIndex)>1 … … 193 181 NbDim(icell)=2; 194 182 end 183 %look for tps data 184 if ~isempty(VarType{icell}.coord_tps) 185 VarType{icell}.var_tps=[]; 186 tps_dimnames=Data.VarDimName{VarType{icell}.coord_tps}; 187 if length(tps_dimnames)==3 188 for ilist=1:length(Data.VarDimName) 189 if strcmp(tps_dimnames{1},Data.VarDimName{ilist}{1}) && strcmp(tps_dimnames{3},Data.VarDimName{ilist}{2})% identify the variables corresponding to the tps site coordinates coord_tps 190 VarType{icell}.var_tps=[VarType{icell}.var_tps ilist]; 191 elseif length(Data.VarDimName{ilist})==1 && strcmp(tps_dimnames{3},Data.VarDimName{ilist}{1})% identify the variable corresponding to nbsites 192 VarType{icell}.nbsites_tps= ilist; 193 elseif length(Data.VarDimName{ilist})==3 && strcmp(tps_dimnames{2},Data.VarDimName{ilist}{1})&& strcmp(tps_dimnames{3},Data.VarDimName{ilist}{3})% identify the variable subrange 194 VarType{icell}.subrange_tps= ilist; 195 end 196 end 197 end 198 NbDim(icell)=2; 199 end 195 200 end -
trunk/src/find_file_series.m
r398 r399 110 110 if ~isempty(r) 111 111 sep1=r.sep1; 112 if strcmp(lower(r.j1),r.j1) 112 i1_str='(?<i1>\d+)'; 113 if strcmp(lower(r.j1),r.j1)% lower case index 113 114 j1_str='(?<j1>[a-z])'; 114 115 else 115 j1_str='(?<j1>[A-Z])'; 116 j1_str='(?<j1>[A-Z])'; % upper case index 116 117 end 117 118 j1_star='*'; -
trunk/src/griddata_uvmat.m
r236 r399 1 1 %'griddata_uvmat': function griddata_uvmat(vec2_X,vec2_Y,vec2_U,vec_X,vec_Y,'linear') 2 2 %adapt the input of the matlab function griddata to the appropriate version of Matlab 3 function ZI = griddata_uvmat(X,Y,Z,XI,YI ,rho)4 if ~exist('rho','var')|| isequal(rho,0)3 function ZI = griddata_uvmat(X,Y,Z,XI,YI) 4 % if ~exist('rho','var')|| isequal(rho,0) 5 5 txt=ver('MATLAB'); 6 6 Release=txt.Release; … … 13 13 ZI=griddata(X,Y,Z,XI,YI,'linear'); 14 14 end 15 else %smooth with thin plate spline16 [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);17 diff_norm=mean(Z_diff.*Z_diff)18 ind_good=find(abs(Z_diff)<5*diff_norm);19 nb_remove=numel(Z_diff)-numel(ind_good)20 if nb_remove>021 X=X(ind_good);22 Y=Y(ind_good);23 Z=Z(ind_good);24 [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);25 diff_norm_new=mean(Z_diff.*Z_diff)26 end27 end15 % else %smooth with thin plate spline 16 % [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho); 17 % diff_norm=mean(Z_diff.*Z_diff) 18 % ind_good=find(abs(Z_diff)<5*diff_norm); 19 % nb_remove=numel(Z_diff)-numel(ind_good) 20 % if nb_remove>0 21 % X=X(ind_good); 22 % Y=Y(ind_good); 23 % Z=Z(ind_good); 24 % [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho); 25 % diff_norm_new=mean(Z_diff.*Z_diff) 26 % end 27 % end -
trunk/src/mouse_motion.m
r388 r399 151 151 end 152 152 end 153 elseif numel(VarType{icell}.coord) >=2 %structured coordinates153 elseif numel(VarType{icell}.coord) >=2 & VarType{icell}.coord > 0 %structured coordinates 154 154 yName=Field.ListVarName{VarType{icell}.coord(1)}; 155 155 xName=Field.ListVarName{VarType{icell}.coord(2)}; -
trunk/src/proj_field.m
r397 r399 1 1 %'proj_field': projects the field on a projection object 2 2 %-------------------------------------------------------------------------- 3 % function [ProjData,errormsg]=proj_field(FieldData,ObjectData ,FieldName)3 % function [ProjData,errormsg]=proj_field(FieldData,ObjectData) 4 4 % 5 5 % OUTPUT: … … 27 27 %FieldData: data of the field to be projected on the projection object, with optional fields 28 28 % .Txt: error message, transmitted to the projection 29 % . CoordType: 'px' or 'phys' type of coordinates of the field, must be the same as for the projection object, transmitted29 % .FieldList: cell array of strings representing the fields to calculate 30 30 % .Mesh: typical distance between data points (used for mouse action or display), transmitted 31 31 % .CoordUnit, .TimeUnit, .dt: transmitted … … 80 80 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 81 81 82 function [ProjData,errormsg]=proj_field(FieldData,ObjectData ,FieldName)82 function [ProjData,errormsg]=proj_field(FieldData,ObjectData) 83 83 errormsg='';%default 84 84 if ~exist('FieldName','var') … … 87 87 %% case of no projection (object is used only as graph display) 88 88 if isfield(ObjectData,'ProjMode') && (isequal(ObjectData.ProjMode,'none')||isequal(ObjectData.ProjMode,'mask_inside')||isequal(ObjectData.ProjMode,'mask_outside')) 89 if ~isempty(FieldName)90 [ProjData,errormsg]=calc_field(FieldName,FieldData);91 else92 89 ProjData=[]; 93 end94 90 return 95 91 end … … 143 139 end 144 140 case 'plane' 145 [ProjData,errormsg] = proj_plane(FieldData,ObjectData ,FieldName);141 [ProjData,errormsg] = proj_plane(FieldData,ObjectData); 146 142 case 'volume' 147 143 [ProjData,errormsg] = proj_volume(FieldData,ObjectData); … … 892 888 %project on a plane 893 889 % AJOUTER flux,circul,error 894 function [ProjData,errormsg] = proj_plane(FieldData, ObjectData ,FieldName)890 function [ProjData,errormsg] = proj_plane(FieldData, ObjectData) 895 891 %----------------------------------------------------------------- 896 892 … … 994 990 % CellVarIndex=cells of variable index arrays 995 991 ivar_new=0; % index of the current variable in the projected field 996 icoord=0;992 % icoord=0; 997 993 nbcoord=0;%number of added coordinate variables brought by projection 998 994 nbvar=0; … … 1000 996 NbDim=NbDimVec(icell); 1001 997 if NbDim<2 1002 continue 998 continue % only cells represnting 2D or 3D fields are involved 1003 999 end 1004 1000 VarIndex=CellVarIndex{icell};% indices of the selected variables in the list FieldData.ListVarName … … 1010 1006 ivar_V=VarType.vector_y; 1011 1007 ivar_W=VarType.vector_z; 1012 ivar_C=VarType.scalar ;1008 % ivar_C=VarType.scalar ; 1013 1009 ivar_Anc=VarType.ancillary; 1014 1010 test_anc=zeros(size(VarIndex)); … … 1016 1012 ivar_F=VarType.warnflag; 1017 1013 ivar_FF=VarType.errorflag; 1018 testX=~isempty(ivar_X) && ~isempty(ivar_Y);1014 check_unstructured_coord=(~isempty(ivar_X) && ~isempty(ivar_Y))||~isempty(VarType.coord_tps); 1019 1015 DimCell=FieldData.VarDimName{VarIndex(1)}; 1020 1016 if ischar(DimCell) … … 1024 1020 %% case of input fields with unstructured coordinates 1025 1021 coord_z=0;%default 1026 if testX 1027 XName=FieldData.ListVarName{ivar_X}; 1028 YName=FieldData.ListVarName{ivar_Y}; 1029 coord_x=FieldData.(XName); 1030 coord_y=FieldData.(YName); 1031 if length(ivar_Z)==1 1032 ZName=FieldData.ListVarName{ivar_Z}; 1033 coord_z=FieldData.(ZName); 1034 end 1035 1036 % translate initial coordinates 1037 coord_x=coord_x-ObjectData.Coord(1,1); 1038 coord_y=coord_y-ObjectData.Coord(1,2); 1039 if ~isempty(ivar_Z) 1040 coord_z=coord_z-ObjectData.Coord(1,3); 1041 end 1042 1043 % selection of the vectors in the projection range (3D case) 1044 if length(ivar_Z)==1 && width > 0 1045 %components of the unitiy vector normal to the projection plane 1046 fieldZ=norm_plane(1)*coord_x + norm_plane(2)*coord_y+ norm_plane(3)*coord_z;% distance to the plane 1047 indcut=find(abs(fieldZ) <= width); 1048 size(indcut) 1049 for ivar=VarIndex 1050 VarName=FieldData.ListVarName{ivar}; 1051 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1052 % A VOIR : CAS DE VAR STRUCTUREE MAIS PAS GRILLE REGULIERE : INTERPOLER SUR GRILLE REGULIERE 1053 end 1054 coord_x=coord_x(indcut); 1055 coord_y=coord_y(indcut); 1056 coord_z=coord_z(indcut); 1057 end 1058 1059 %rotate coordinates if needed: 1060 Psi=PlaneAngle(1); 1061 Theta=PlaneAngle(2); 1062 Phi=PlaneAngle(3); 1063 if testangle && ~test90y && ~test90x;%=1 for slanted plane 1064 coord_X=(coord_x *cos(Phi) + coord_y* sin(Phi)); 1065 coord_Y=(-coord_x *sin(Phi) + coord_y *cos(Phi))*cos(Theta); 1066 coord_Y=coord_Y+coord_z *sin(Theta); 1067 coord_X=(coord_X *cos(Psi) - coord_Y* sin(Psi));%A VERIFIER 1068 1069 coord_Y=(coord_X *sin(Psi) + coord_Y* cos(Psi)); 1070 else 1071 coord_X=coord_x; 1072 coord_Y=coord_y; 1073 end 1074 1075 %restriction to the range of x and y if imposed 1076 testin=ones(size(coord_X)); %default 1077 testbound=0; 1078 if testXMin 1079 testin=testin & (coord_X >= XMin); 1080 testbound=1; 1081 end 1082 if testXMax 1083 testin=testin & (coord_X <= XMax); 1084 testbound=1; 1085 end 1086 if testYMin 1087 testin=testin & (coord_Y >= YMin); 1088 testbound=1; 1089 end 1090 if testYMin 1091 testin=testin & (coord_Y <= YMax); 1092 testbound=1; 1093 end 1094 if testbound 1095 indcut=find(testin); 1096 for ivar=VarIndex 1097 VarName=FieldData.ListVarName{ivar}; 1098 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1099 end 1100 coord_X=coord_X(indcut); 1101 coord_Y=coord_Y(indcut); 1022 if check_unstructured_coord 1023 if ~isempty(ivar_X)% case of tps excluded. TODO similar procedure 1024 XName=FieldData.ListVarName{ivar_X}; 1025 YName=FieldData.ListVarName{ivar_Y}; 1026 coord_x=FieldData.(XName); 1027 coord_y=FieldData.(YName); 1102 1028 if length(ivar_Z)==1 1103 coord_Z=coord_Z(indcut); 1029 ZName=FieldData.ListVarName{ivar_Z}; 1030 coord_z=FieldData.(ZName); 1031 end 1032 1033 % translate initial coordinates 1034 coord_x=coord_x-ObjectData.Coord(1,1); 1035 coord_y=coord_y-ObjectData.Coord(1,2); 1036 if ~isempty(ivar_Z) 1037 coord_z=coord_z-ObjectData.Coord(1,3); 1038 end 1039 1040 % selection of the vectors in the projection range (3D case) 1041 if length(ivar_Z)==1 && width > 0 1042 %components of the unitiy vector normal to the projection plane 1043 fieldZ=norm_plane(1)*coord_x + norm_plane(2)*coord_y+ norm_plane(3)*coord_z;% distance to the plane 1044 indcut=find(abs(fieldZ) <= width); 1045 size(indcut) 1046 for ivar=VarIndex 1047 VarName=FieldData.ListVarName{ivar}; 1048 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1049 % A VOIR : CAS DE VAR STRUCTUREE MAIS PAS GRILLE REGULIERE : INTERPOLER SUR GRILLE REGULIERE 1050 end 1051 coord_x=coord_x(indcut); 1052 coord_y=coord_y(indcut); 1053 coord_z=coord_z(indcut); 1054 end 1055 1056 %rotate coordinates if needed: 1057 Psi=PlaneAngle(1); 1058 Theta=PlaneAngle(2); 1059 Phi=PlaneAngle(3); 1060 if testangle && ~test90y && ~test90x;%=1 for slanted plane 1061 coord_X=(coord_x *cos(Phi) + coord_y* sin(Phi)); 1062 coord_Y=(-coord_x *sin(Phi) + coord_y *cos(Phi))*cos(Theta); 1063 coord_Y=coord_Y+coord_z *sin(Theta); 1064 coord_X=(coord_X *cos(Psi) - coord_Y* sin(Psi));%A VERIFIER 1065 1066 coord_Y=(coord_X *sin(Psi) + coord_Y* cos(Psi)); 1067 else 1068 coord_X=coord_x; 1069 coord_Y=coord_y; 1070 end 1071 1072 %restriction to the range of x and y if imposed 1073 testin=ones(size(coord_X)); %default 1074 testbound=0; 1075 if testXMin 1076 testin=testin & (coord_X >= XMin); 1077 testbound=1; 1078 end 1079 if testXMax 1080 testin=testin & (coord_X <= XMax); 1081 testbound=1; 1082 end 1083 if testYMin 1084 testin=testin & (coord_Y >= YMin); 1085 testbound=1; 1086 end 1087 if testYMin 1088 testin=testin & (coord_Y <= YMax); 1089 testbound=1; 1090 end 1091 if testbound 1092 indcut=find(testin); 1093 for ivar=VarIndex 1094 VarName=FieldData.ListVarName{ivar}; 1095 eval(['FieldData.' VarName '=FieldData.' VarName '(indcut);']) 1096 end 1097 coord_X=coord_X(indcut); 1098 coord_Y=coord_Y(indcut); 1099 if length(ivar_Z)==1 1100 coord_Z=coord_Z(indcut); 1101 end 1104 1102 end 1105 1103 end 1106 1104 % different cases of projection 1107 if isequal(ObjectData.ProjMode,'projection') 1108 %the list of dimension 1109 %ProjData.ListDimName=[ProjData.ListDimName FieldData.VarDimName(VarIndex(1))];%add the point index to the list of dimensions 1110 %ProjData.DimValue=[ProjData. 1111 %length(coord_X)]; 1112 1113 for ivar=VarIndex %transfer variables to the projection plane 1114 VarName=FieldData.ListVarName{ivar}; 1115 if ivar==ivar_X %x coordinate 1116 eval(['ProjData.' VarName '=coord_X;']) 1117 elseif ivar==ivar_Y % y coordinate 1118 eval(['ProjData.' VarName '=coord_Y;']) 1119 elseif isempty(ivar_Z) || ivar~=ivar_Z % other variables (except Z coordinate wyhich is not reproduced) 1120 eval(['ProjData.' VarName '=FieldData.' VarName ';']) 1121 end 1122 if isempty(ivar_Z) || ivar~=ivar_Z 1123 ProjData.ListVarName=[ProjData.ListVarName VarName]; 1124 ProjData.VarDimName=[ProjData.VarDimName DimCell]; 1125 nbvar=nbvar+1; 1126 if isfield(FieldData,'VarAttribute') && length(FieldData.VarAttribute) >=ivar 1127 ProjData.VarAttribute{nbvar}=FieldData.VarAttribute{ivar}; 1128 end 1129 end 1130 end 1131 elseif isequal(ObjectData.ProjMode,'interp')||isequal(ObjectData.ProjMode,'filter')%interpolate data on a regular grid 1132 if isequal(ObjectData.ProjMode,'filter') 1133 rho=1000;%smoothing parameter, (small for strong smoothing) 1134 else 1135 rho=0; 1136 end 1137 coord_x_proj=XMin:DX:XMax; 1138 coord_y_proj=YMin:DY:YMax; 1139 if isfield(FieldData,[VarName '_tps']) 1140 [XI,YI]=meshgrid(coord_x_proj,coord_y_proj'); 1141 XI=reshape(XI,[],1); 1142 YI=reshape(YI,[],1); 1143 end 1144 DimCell={'coord_y','coord_x'}; 1145 ProjData.ListVarName={'coord_y','coord_x'}; 1146 ProjData.VarDimName={'coord_y','coord_x'}; 1147 nbcoord=2; 1148 ProjData.coord_y=[YMin YMax]; 1149 ProjData.coord_x=[XMin XMax]; 1150 if isempty(ivar_X), ivar_X=0; end; 1151 if isempty(ivar_Y), ivar_Y=0; end; 1152 if isempty(ivar_Z), ivar_Z=0; end; 1153 if isempty(ivar_U), ivar_U=0; end; 1154 if isempty(ivar_V), ivar_V=0; end; 1155 if isempty(ivar_W), ivar_W=0; end; 1156 if isempty(ivar_F), ivar_F=0; end; 1157 if isempty(ivar_FF), ivar_FF=0; end; 1158 if ~isequal(ivar_FF,0) 1159 VarName_FF=FieldData.ListVarName{ivar_FF}; 1160 eval(['indsel=find(FieldData.' VarName_FF '==0);']) 1161 coord_X=coord_X(indsel); 1162 coord_Y=coord_Y(indsel); 1163 end 1164 FF=zeros(1,length(coord_y_proj)*length(coord_x_proj)); 1165 testFF=0; 1166 FieldName 1167 if ~isempty(FieldName) 1168 ProjData=calc_field(FieldName,FieldData,[XI YI]); 1169 else 1105 switch ObjectData.ProjMode 1106 case 'projection' 1107 %the list of dimension 1108 %ProjData.ListDimName=[ProjData.ListDimName FieldData.VarDimName(VarIndex(1))];%add the point index to the list of dimensions 1109 %ProjData.DimValue=[ProjData. 1110 %length(coord_X)]; 1111 1112 for ivar=VarIndex %transfer variables to the projection plane 1113 VarName=FieldData.ListVarName{ivar}; 1114 if ivar==ivar_X %x coordinate 1115 eval(['ProjData.' VarName '=coord_X;']) 1116 elseif ivar==ivar_Y % y coordinate 1117 eval(['ProjData.' VarName '=coord_Y;']) 1118 elseif isempty(ivar_Z) || ivar~=ivar_Z % other variables (except Z coordinate wyhich is not reproduced) 1119 eval(['ProjData.' VarName '=FieldData.' VarName ';']) 1120 end 1121 if isempty(ivar_Z) || ivar~=ivar_Z 1122 ProjData.ListVarName=[ProjData.ListVarName VarName]; 1123 ProjData.VarDimName=[ProjData.VarDimName DimCell]; 1124 nbvar=nbvar+1; 1125 if isfield(FieldData,'VarAttribute') && length(FieldData.VarAttribute) >=ivar 1126 ProjData.VarAttribute{nbvar}=FieldData.VarAttribute{ivar}; 1127 end 1128 end 1129 end 1130 case 'interp'%interpolate data on a regular grid 1131 coord_x_proj=XMin:DX:XMax; 1132 coord_y_proj=YMin:DY:YMax; 1133 DimCell={'coord_y','coord_x'}; 1134 ProjData.ListVarName={'coord_y','coord_x'}; 1135 ProjData.VarDimName={'coord_y','coord_x'}; 1136 nbcoord=2; 1137 ProjData.coord_y=[YMin YMax]; 1138 ProjData.coord_x=[XMin XMax]; 1139 if isempty(ivar_X), ivar_X=0; end; 1140 if isempty(ivar_Y), ivar_Y=0; end; 1141 if isempty(ivar_Z), ivar_Z=0; end; 1142 if isempty(ivar_U), ivar_U=0; end; 1143 if isempty(ivar_V), ivar_V=0; end; 1144 if isempty(ivar_W), ivar_W=0; end; 1145 if isempty(ivar_F), ivar_F=0; end; 1146 if isempty(ivar_FF), ivar_FF=0; end; 1147 if ~isequal(ivar_FF,0) 1148 VarName_FF=FieldData.ListVarName{ivar_FF}; 1149 eval(['indsel=find(FieldData.' VarName_FF '==0);']) 1150 coord_X=coord_X(indsel); 1151 coord_Y=coord_Y(indsel); 1152 end 1153 1154 FF=zeros(1,length(coord_y_proj)*length(coord_x_proj)); 1155 testFF=0; 1170 1156 for ivar=VarIndex 1171 1157 VarName=FieldData.ListVarName{ivar}; … … 1180 1166 FieldData.(VarName)=FieldData.(VarName)(indsel); 1181 1167 end 1182 % if isfield(FieldData,[VarName '_tps']) 1183 % [XI,YI]=meshgrid(coord_x_proj,coord_y_proj'); 1184 % XI=reshape(XI,[],1); 1185 % YI=reshape(YI,[],1); 1186 % 1187 ProjData.(VarName)=griddata_uvmat(double(coord_X),double(coord_Y),double(FieldData.(VarName)),coord_x_proj,coord_y_proj',rho); 1168 ProjData.(VarName)=griddata_uvmat(double(coord_X),double(coord_Y),double(FieldData.(VarName)),coord_x_proj,coord_y_proj'); 1188 1169 varline=reshape(ProjData.(VarName),1,length(coord_y_proj)*length(coord_x_proj)); 1189 1170 FFlag= isnan(varline); %detect undefined values NaN … … 1212 1193 ProjData.VarAttribute{ivar_new+1+nbcoord}.Role='errorflag'; 1213 1194 end 1214 end 1215 end 1216 1195 case 'filter' 1196 if ~isempty(VarType.coord_tps) 1197 VarType.coord_tps 1198 coord_x_proj=XMin:DX:XMax; 1199 coord_y_proj=YMin:DY:YMax; 1200 np_x=numel(coord_x_proj); 1201 np_y=numel(coord_y_proj); 1202 [XI,YI]=meshgrid(coord_x_proj,coord_y_proj'); 1203 XI=reshape(XI,[],1); 1204 YI=reshape(YI,[],1); 1205 ProjData=calc_field(FieldData.FieldList,FieldData,[XI YI]); 1206 for ilist=3:length(ProjData.ListVarName)% reshape data, excluding coordinates (ilist=1-2), TODO: rationalise 1207 VarName=ProjData.ListVarName{ilist}; 1208 ProjData.(VarName)=reshape(ProjData.(VarName),np_y,np_x); 1209 end 1210 ProjData.coord_x=[XMin XMax]; 1211 ProjData.coord_y=[YMin YMax]; 1212 end 1213 end 1217 1214 %% case of input fields defined on a structured grid 1218 1215 else … … 1352 1349 % case with no interpolation 1353 1350 if isequal(ProjMode,'projection') && (~testangle || test90y || test90x) 1354 if NbDim==2 && ~testXMin && ~testXMax && ~testYMin && ~testYMax 1351 if NbDim==2 && ~testXMin && ~testXMax && ~testYMin && ~testYMax 1355 1352 ProjData=FieldData;% no change by projection 1356 1353 else … … 1375 1372 min_indx=ceil((Coord{NbDim}(1)-XMax)/DXinit)+1; 1376 1373 max_indx=floor((Coord{NbDim}(1)-XMin)/DXinit)+1; 1377 Xbound(2)=Coord{NbDim}(1)+DXinit*(max_indx-1); 1374 Xbound(2)=Coord{NbDim}(1)+DXinit*(max_indx-1); 1378 1375 Xbound(1)=Coord{NbDim}(1)+DXinit*(min_indx-1); 1379 1376 end 1380 1377 min_indy=max(min_indy,1);% deals with margin (bound lower than the first index) 1381 1378 min_indx=max(min_indx,1); 1382 1379 1383 1380 if test90y 1384 1381 ind_new=[3 2 1]; 1385 1382 DimCell={AYProjName,AXProjName}; 1386 % DimValue=DimValue(ind_new);1383 % DimValue=DimValue(ind_new); 1387 1384 iz=ceil((ObjectData.Coord(1,1)-Coord{3}(1))/DX)+1; 1388 1385 for ivar=VarIndex … … 1656 1653 ivar_F=VarType.warnflag; 1657 1654 ivar_FF=VarType.errorflag; 1658 testX=~isempty(ivar_X) && ~isempty(ivar_Y);1655 check_unstructured_coord=~isempty(ivar_X) && ~isempty(ivar_Y); 1659 1656 DimCell=FieldData.VarDimName{VarIndex(1)}; 1660 1657 if ischar(DimCell) … … 1663 1660 1664 1661 %% case of input fields with unstructured coordinates 1665 if testX1662 if check_unstructured_coord 1666 1663 XName=FieldData.ListVarName{ivar_X}; 1667 1664 YName=FieldData.ListVarName{ivar_Y}; -
trunk/src/series.m
r398 r399 1054 1054 if ~isempty(SeriesData.i2_series)||~isempty(SeriesData.j2_series) 1055 1055 if isequal(mode,'series(Di)') 1056 find_netcpair_civ(handles ,Val);% update the menu of pairs depending on the available netcdf files1056 find_netcpair_civ(handles);% update the menu of pairs depending on the available netcdf files 1057 1057 end 1058 1058 end … … 1069 1069 if ~isempty(SeriesData.i2_series)||~isempty(SeriesData.j2_series) 1070 1070 if isequal(mode,'series(Di)') 1071 find_netcpair_civ(handles ,Val);% update the menu of pairs depending on the available netcdf files1071 find_netcpair_civ(handles);% update the menu of pairs depending on the available netcdf files 1072 1072 end 1073 1073 end -
trunk/src/uvmat.m
r398 r399 310 310 end 311 311 if isfield(input,'FieldsString') 312 % set(handles.Fields,'Value',1)313 312 UvData.FieldsString=input.FieldsString; 314 313 end … … 486 485 handles_NomType=handles.NomType; 487 486 handles_FileExt=handles.FileExt; 488 handles_Fields=handles.Fields;487 % handles_Fields=handles.Fields; 489 488 elseif index==2 490 489 handles_RootPath=handles.RootPath_1; … … 494 493 handles_NomType=handles.NomType_1; 495 494 handles_FileExt=handles.FileExt_1; 496 handles_Fields=handles.Fields_1;495 % handles_Fields=handles.Fields_1; 497 496 set(handles.RootPath_1,'Visible','on') 498 497 set(handles.RootFile_1,'Visible','on') … … 504 503 505 504 %% detect root name, nomenclature and indices in the input file name: 506 %[RootPath,SubDir]=fileparts_uvmat(fileinput);507 505 [FilePath,FileName,FileExt]=fileparts(fileinput); 508 506 % detect the file type, get the movie object if relevant, and look for the corresponding file series: 509 507 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists 510 508 [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]); 511 % if strcmp(NomType,'*')% movies will be opened at the first frame512 % i1=1;513 % i2=[];514 % j1=[];515 % j2=[];516 % end517 509 518 510 %% open the file or fill the GUI uvmat according to the detected file type … … 1964 1956 FieldName=[];%default 1965 1957 VelType=[];%default 1966 FileExt=get(handles.FileExt,'String');1958 % FileExt=get(handles.FileExt,'String'); 1967 1959 FileType=UvData.FileType{1}; 1968 1960 switch FileType … … 2234 2226 UvData.Field=Field{1}; 2235 2227 end 2228 UvData.Field.FieldList={FieldName}; % TODO: to generalise, used for proj_field with tps interpolation 2236 2229 2237 2230 %% get bounds and mesh (needed for mouse action and to open set_object) … … 3818 3811 AxeData=UvData.axes3;% retrieve the current plotted data 3819 3812 PlotParam=read_GUI(handles.uvmat); 3820 [ PP,PlotParamOut]= plot_field(AxeData,handles.axes3,PlotParam);3813 [tild,PlotParamOut]= plot_field(AxeData,handles.axes3,PlotParam); 3821 3814 write_plot_param(handles,PlotParamOut); %update the auto plot parameters 3822 3815 … … 3826 3819 %------------------------------------------------------------------- 3827 3820 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 3828 test=get(handles.edit_object,'Value'); 3829 if test 3821 if get(handles.edit_object,'Value') 3830 3822 set(handles.edit_object,'BackgroundColor',[1,1,0]) 3831 3823 %suppress the other options … … 3838 3830 set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 3839 3831 end 3832 hset_object=findobj(allchild(0),'Tag','set_object'); 3833 if isempty(hset_object)% open the GUI set_object with data of the currently selected object 3834 ViewObject_Callback(hObject, eventdata, handles) 3835 hset_object=findobj(allchild(0),'Tag','set_object'); 3836 end 3837 hhset_object=guidata(hset_object); 3838 set(hhset_object.PLOT,'enable','on'); 3840 3839 else 3841 3840 UvData.MouseAction='none'; 3842 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 3843 end 3844 set(handles.uvmat,'UserData',UvData); 3845 hset_object=findobj(allchild(0),'Tag','set_object'); 3846 if ~isempty(hset_object) 3847 hhset_object=guidata(hset_object); 3848 if test 3849 set(hhset_object.PLOT,'enable','on'); 3850 else 3851 set(hhset_object.PLOT,'enable','off'); 3841 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 3842 hset_object=findobj(allchild(0),'Tag','set_object'); 3843 if ~isempty(hset_object)% open the 3844 hhset_object=guidata(hset_object); 3845 set(hhset_object.PLOT,'enable','off'); 3852 3846 end 3853 3847 end … … 4567 4561 end 4568 4562 4563 %------------------------------------------------------------------------ 4569 4564 % --- Executes on button press in ViewObject. 4570 4565 function ViewObject_Callback(hObject, eventdata, handles) 4566 %------------------------------------------------------------------------ 4571 4567 IndexObj=get(handles.ListObject,'Value'); 4572 4568 IndexObj=IndexObj(end); %keeps only the secodn value
Note: See TracChangeset
for help on using the changeset viewer.