Changeset 883 for trunk/src/transform_field/diff_vel.m
 Timestamp:
 Mar 13, 2015, 8:19:39 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/transform_field/diff_vel.m
r876 r883 35 35 %======================================================================= 36 36 37 function SubData=diff_vel(Field,XmlData,Field_1)37 function Field=diff_vel(Field,XmlData,Field_1) 38 38 39 SubData=Field; 39 %% request input parameters 40 if isfield(Field,'Action') && isfield(Field.Action,'RUN') && isequal(Field.Action.RUN,0) 41 42 %default input: 43 def={'1'};% multiplicative factor for the second velocity field 44 45 if isfield(XmlData,'TransformInput')% if parameters have been memorised 46 if isfield(XmlData.TransformInput,'Factor') 47 def{1}=num2str(XmlData.TransformInput.Factor); 48 end 49 end 50 num_lines= 1;%numel(prompt); 51 % open the dialog fig 52 prompt='enter scale factor for the second field'; 53 answer = inputdlg(prompt,'',num_lines,def); 54 Field.TransformInput.Factor=str2num(answer{1}); 55 return 56 end 57 Factor=1; 58 if isfield(XmlData,'TransformInput') && isfield(XmlData.TransformInput,'Factor') 59 Factor=XmlData.TransformInput.Factor; 60 end 40 61 if exist('Field_1','var') 41 62 F.U=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.U,'linear'); 42 SubData.U=Field.UF.U(Field.X,Field.Y);%substract the interpolated ref to U63 Field.U=Field.UFactor*F.U(Field.X,Field.Y);%substract the interpolated ref to U 43 64 F.V=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.V,'linear'); 44 SubData.V=Field.VF.V(Field.X,Field.Y);%substract the interpolated ref to V65 Field.V=Field.VFactor*F.V(Field.X,Field.Y);%substract the interpolated ref to V 45 66 end 46 67
Note: See TracChangeset
for help on using the changeset viewer.