changeset 12609:c84a3b399d19 octave-forge

fix bug #44989 - Inappropriate check of Matlab version with Octave 4.0
author schloegl
date Mon, 04 May 2015 15:55:09 +0000
parents 89788e3f77db
children b5925d668a3a
files extra/tsa/inst/sinvest1.m
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/extra/tsa/inst/sinvest1.m	Mon Apr 27 09:17:42 2015 +0000
+++ b/extra/tsa/inst/sinvest1.m	Mon May 04 15:55:09 2015 +0000
@@ -211,14 +211,14 @@
                 ylabel('imag(z)');
                 
                 MATLAB_VERSION = version;
-                if MATLAB_VERSION(1)=='4'
+                if exist ("OCTAVE_VERSION", "builtin") || MATLAB_VERSION(1)=='5'
+                        ax = gca;
+                        tmp = get(ax,'DataAspectRatio');
+                        set(ax,'PlotBoxAspectRatio',tmp);
+                elseif MATLAB_VERSION(1)=='4'
                         ax = gca;
                         tmp = get(ax,'Aspect');
                         set(ax,'Aspect',[tmp(1),1]);
-                elseif MATLAB_VERSION(1)=='5'
-                        ax = gca;
-                        tmp = get(ax,'DataAspectRatio');
-                        set(ax,'PlotBoxAspectRatio',tmp);
                 end;
         elseif K==11
                 plot([Y(:) filter([1 -ARPMX(:,oo/2*(oo-1)+(1:oo))],1,Y(:))-max(Y)+min(Y)]);