Changeset 535 for trunk/src/uvmat.m
- Timestamp:
- Sep 3, 2012, 2:02:13 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r534 r535 293 293 display_file_name(handles,inputfile) 294 294 %%%%%%% 295 testinputfield=1;296 295 end 297 296 … … 2404 2403 %% get bounds and mesh (needed to propose default options for projection objects) 2405 2404 if NbDim>1 2406 CoordMax=zeros(1,numel(imax)); 2407 CoordMin=zeros(1,numel(imax)); 2405 CoordMax=zeros(numel(imax),NbDim); 2406 CoordMin=zeros(numel(imax),NbDim); 2407 Mesh=zeros(numel(imax),NbDim); 2408 2408 for ind=1:numel(imax) 2409 2409 XName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end)}; 2410 2410 YName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end-1)}; 2411 CoordMax(ind, 1)=max(max(UvData.Field.(XName)));2412 CoordMin(ind, 1)=min(min(UvData.Field.(XName)));2413 CoordMax(ind, 2)=max(max(UvData.Field.(YName)));2414 CoordMin(ind, 2)=min(min(UvData.Field.(YName)));2411 CoordMax(ind,NbDim)=max(max(UvData.Field.(XName))); 2412 CoordMin(ind,NbDim)=min(min(UvData.Field.(XName))); 2413 CoordMax(ind,NbDim-1)=max(max(UvData.Field.(YName))); 2414 CoordMin(ind,NbDim-1)=min(min(UvData.Field.(YName))); 2415 2415 % test_x=1;%test for unstructured coordinates 2416 2416 if NbDim==3 2417 2417 ZName=UvData.Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(1)}; 2418 CoordMax(imax(ind), 3)=max(max(UvData.Field.(ZName)));2419 CoordMin(ind, 3)=min(min(UvData.Field.(ZName)));2418 CoordMax(imax(ind),1)=max(max(UvData.Field.(ZName))); 2419 CoordMin(ind,1)=min(min(UvData.Field.(ZName))); 2420 2420 end 2421 2421 … … 2423 2423 2424 2424 case 'scattered' %unstructured coordinates 2425 NbPoints (ind)=CellInfo{imax(ind)}.CoordSize;% nbre of points2426 Mesh(ind )=(prod(CoordMax(ind,:)-CoordMin(ind,:))/NbPoints)^(1/NbDim); %(volume or area per point)^(1/NbDim)2425 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points 2426 Mesh(ind,:)=(prod(CoordMax(ind,:)-CoordMin(ind,:))/NbPoints)^(1/NbDim); %(volume or area per point)^(1/NbDim) 2427 2427 case 'grid'%structured coordinate 2428 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points 2429 Mesh(ind)=min((CoordMax(ind,:)-CoordMin(ind,:))./NbPoints); 2430 2428 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points in each direction 2429 Mesh(ind,:)=min((CoordMax(ind,:)-CoordMin(ind,:))./(NbPoints-1)); 2431 2430 end 2432 2431 end … … 2525 2524 % main projection object (uvmat display) 2526 2525 list_object=get(handles.ListObject_1,'String'); 2527 if isequal(list_object,{''}) %refresh list of objects if the menu is empty2526 if isequal(list_object,{''})||isequal(list_object,' ')%refresh list of objects if the menu is empty 2528 2527 set(handles.ListObject,'Value',1) 2529 2528 set(handles.ListObject,'String',{'plane'})
Note: See TracChangeset
for help on using the changeset viewer.