[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
matlab and octave
From: |
A. S. Budden |
Subject: |
matlab and octave |
Date: |
Tue, 18 Nov 2003 12:17:25 +0000 |
User-agent: |
Mutt/1.4.1i-nntp3 |
Hi there,
I use both octave and matlab a lot -- octave on my laptop and matlab on
the university machines. Is there any way of adding lines into a .m
file such that either matlab or octave (mainly the former) will ignore
the command. For example, I have a file with the line replot --
this seems to be required in octave to update the gnuplot window.
However, matlab generates an error message if I run it there. I realise
I could make a function called replot that does nothing in matlab and
put it in a central store, but this could get messy if there are a lot
of functions that are required.
Also, I've found that the axis command doesn't seem to work very well in
octave. In my .m file I have a function plot_ab (at the end of this
email). The line ax=axis returns [-1.8131 1.3346 -0.9580 1.5246] in
matlab and the plot virtually fills the window. In octave, ax=axis
returns [-10 10 -10 10] and the plot is only about 1/10 the size of the
window.
Can anyone offer any suggestions with either of these problems?
Many thanks in advance,
Al
function plot_ab(parametera, parameterb);
% Plot first parameter against second parameter with fixed axis
% for i=1:size(parametera,1)
for i=1:size(parametera,1),
plot(parametera(i,:), parameterb(i,:), 'b-', 0,0,'bx');
if ( i==1 )
axis('equal');
replot;
% Add 50% on to each axis and remember
ax = axis;
if (abs(ax(1)) > abs(ax(2)))
ax(2) = -ax(1);
else
ax(1) = -ax(2);
end;
if (abs(ax(3)) > abs(ax(4)))
ax(4) = -ax(3);
else
ax(3) = -ax(4);
end;
ax = ax*1.2;
axis(ax)
axis('equal');
replot;
ax = axis;
end;
axis(ax);
xlabel('\alpha Axis Current');
ylabel('\beta Axis Current');
pause(0.1);
end;
-------------------------------------------------------------
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
-------------------------------------------------------------
- matlab and octave,
A. S. Budden <=
- Re: matlab and octave, Laurent Jacques, 2003/11/18
- Re: matlab and octave, Geraint Paul Bevan, 2003/11/18
- Re: matlab and octave, David Bateman, 2003/11/18
- Re: matlab and octave, Geraint Paul Bevan, 2003/11/18
- Re: matlab and octave, David Bateman, 2003/11/18
- Re: matlab and octave, John W. Eaton, 2003/11/18
- Re: matlab and octave, Carlo de Falco, 2003/11/23
Re: matlab and octave, Miquel Cabanas, 2003/11/18
Re: matlab and octave, Andy Adler, 2003/11/18