comparison src/data.cc @ 4732:b484cdca27be

[project @ 2004-02-04 04:32:48 by jwe]
author jwe
date Wed, 04 Feb 2004 04:32:48 +0000
parents 14a1c9f42f67
children 7bd3748e2735
comparison
equal deleted inserted replaced
4731:176fcf62c464 4732:b484cdca27be
565 static octave_value 565 static octave_value
566 make_diag (const octave_value& a, const octave_value& b) 566 make_diag (const octave_value& a, const octave_value& b)
567 { 567 {
568 octave_value retval; 568 octave_value retval;
569 569
570 int k = b.nint_value (); 570 int k = b.int_value ();
571 571
572 if (error_state) 572 if (error_state)
573 { 573 {
574 error ("diag: invalid second argument"); 574 error ("diag: invalid second argument");
575 return retval; 575 return retval;
844 retval(0) = m; 844 retval(0) = m;
845 } 845 }
846 } 846 }
847 else if (nargin == 2 && nargout < 2) 847 else if (nargin == 2 && nargout < 2)
848 { 848 {
849 int nd = args(1).nint_value (); 849 int nd = args(1).int_value (true);
850 850
851 if (error_state) 851 if (error_state)
852 error ("size: expecting scalar as second argument"); 852 error ("size: expecting scalar as second argument");
853 else 853 else
854 { 854 {
1058 { 1058 {
1059 dims.resize (nargin); 1059 dims.resize (nargin);
1060 1060
1061 for (int i = 0; i < nargin; i++) 1061 for (int i = 0; i < nargin; i++)
1062 { 1062 {
1063 dims(i) = args(i).is_empty () ? 0 : args(i).nint_value (); 1063 dims(i) = args(i).is_empty () ? 0 : args(i).int_value ();
1064 1064
1065 if (error_state) 1065 if (error_state)
1066 { 1066 {
1067 error ("%s: expecting scalar arguments", fcn); 1067 error ("%s: expecting scalar integer arguments", fcn);
1068 break; 1068 break;
1069 } 1069 }
1070 } 1070 }
1071 } 1071 }
1072 break; 1072 break;
1245 print_usage ("linspace"); 1245 print_usage ("linspace");
1246 return retval; 1246 return retval;
1247 } 1247 }
1248 1248
1249 if (nargin == 3) 1249 if (nargin == 3)
1250 npoints = args(2).nint_value (); 1250 npoints = args(2).int_value ();
1251 1251
1252 if (! error_state) 1252 if (! error_state)
1253 { 1253 {
1254 octave_value arg_1 = args(0); 1254 octave_value arg_1 = args(0);
1255 octave_value arg_2 = args(1); 1255 octave_value arg_2 = args(1);
1279 if (! error_state) 1279 if (! error_state)
1280 retval = rv; 1280 retval = rv;
1281 } 1281 }
1282 } 1282 }
1283 } 1283 }
1284 else
1285 error ("linspace: expecting third argument to be an integer");
1284 1286
1285 return retval; 1287 return retval;
1286 } 1288 }
1287 1289
1288 DEFUN (reshape, args, , 1290 DEFUN (reshape, args, ,