diff m-toolbox/classes/@unit/setVals.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@unit/setVals.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,20 @@
+% SETVALS set the vals field of the unit
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: SETVALS set the vals field of the unit.
+%
+% CALL:        a = a.setVals(vals)
+%
+% VERSION:     $Id: setVals.m,v 1.3 2011/04/08 08:56:35 hewitson Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function u = setVals(u, v)
+  
+  if numel(v) ~= numel(u.vals)
+    error('### Can''t change the number of elements in <vals>.');
+  end
+  
+  u.vals = v;
+  
+end