help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to keep print compatiable with MATLAB


From: David Bateman
Subject: Re: How to keep print compatiable with MATLAB
Date: Mon, 26 Apr 2004 05:02:25 +0200
User-agent: Mutt/1.4.1i

According to Etienne Grossmann <address@hidden> (on 04/25/04):
> 
>   Hello,
> 
> what about sthing like:
> 
>   if exist ("octave_config_info")
>     ## Octave code
>   else
>     ## Matlab code
>   end

I prefer to test for OCTAVE_VERSION, but hey. You might need to also
use "eval" of functions that exist in Octave and not matlab and
vis-a-versa to avoid parse errors. For instance your example would
become

if exist ("octave_config_info")
 %plot frequency response
 N = 16634;
 [h, f] = freqz(B, A, N, fs);
 eval('gset terminal windows');
 eval('gset title "A-weighting Cureve Frequecny Response"');
 eval('gset grid');
 eval('gset nokey');
 semilogx(f, 20*log10(abs(h)));
 
 %print plot to PNG pic file
 eval('gset terminal png');
 eval('gset output "myplot.png"')
 replot
else
 % Matlab code
end


-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]