Optimization: fix empty matrix addition 42/18542/2
Paul Bignier [Thu, 8 Sep 2016 08:10:41 +0000 (10:10 +0200)]
 * bug_244.tst now passes again (it displayed a warning)

Change-Id: I0f5ecc430eb5c18b9770a2f81c23cef17447dd68

scilab/modules/graphics/macros/fplot2d.sci

index 9b0722f..f7f4723 100644 (file)
@@ -44,6 +44,11 @@ function []=fplot2d(xr,f,style,strf,leg,rect,nax,void)
     if size(opts,2)<rhs-2 then
         error(msprintf(gettext("%s: Wrong value for input argument: ''%s'', ''%s'', ''%s'', ''%s'', ''%s'', ''%s'', ''%s'' or ''%s'' expected.\n"),"fplot2d","style","strf","leg","rect","nax","logflag","frameflag","axesflag"));
     end
-    execstr("plot2d(xr,feval(xr,f),"+strcat(opts,",")+")")
+
+    if isempty(opts) then
+        plot2d(xr,feval(xr,f))
+    else
+        execstr("plot2d(xr,feval(xr,f),"+strcat(opts,",")+")")
+    end
 
 endfunction