help-octave
[Top][All Lists]
Advanced

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

Re: xlabel not visible on plot


From: Lukas Reichlin
Subject: Re: xlabel not visible on plot
Date: Tue, 30 Jun 2009 20:51:22 +0200

I had been unaware the aquaterm could save its windows contents as
eps (pdf too).

In any event, line 45 of gca.m is (should be) ...

        h = axes ();

What happens if you type

        clear all
        close all
        axes
        plot (1:10)

also, what does your path look like (just type "path")?

Ben

Yes, line 45 is
        h = axes ();

For the first time,
        clear all
        close all
        axes
        plot(1:10)
delivered a simple plot. Then I tried to run the m-file again. It
didn't work, I got the same error message as before. Afterwards, I
tried those four commands again and I got the following error:
error: invalid use of script in index expression
error: called from:
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/gca.m at line 45, column 9
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/__plt_get_axis_arg__.m at line 63, column 4
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/plot.m at line 178, column 18


I installed the control package and I tried your script with
octave-3.2.x (developers sources). I do not get the error above.

Please try running the script I've attached (it is yours from your
initial email, with the axes position changed).

If it works for you, please send me a script that does not work.

Ben
<lukas.m>


Thank you. I'm sorry, but it still doesn't work. I get

error: invalid use of script in index expression
error: called from:
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/gca.m at line 45, column 9
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/__plt_get_axis_arg__.m at line 63, column 4
error:   /Applications/Octave/Octave.app/Contents/Resources/share/
octave/3.2.0/m/plot/semilogx.m at line 32, column 18
error:   /Users/lukas/lukas.m at line 79, column 1

Line 79 is the semilogx command. May I have to delete some kind of
"Preference" files?


Regarding "preferences", you can check to see what might be in ~/.octaverc

For the sake of being thorough, I downloaded both the ppc and i386 versions of Octave-3.2.0. The script ran cleanly for me on both a PPC based Mac and a i386 (each running 10.5.7).

Thus, it does appear you have a problem local to your installation. In the event you have inadvertently modified a core function, you might try a fresh install.

Ben

I did a fresh install of Octave, Gnuplot and Aquaterm and deleted .octaveverc. But I still get:

error: invalid use of script in index expression
error: called from:
error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/gca.m at line 45, column 9 error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/__plt_get_axis_arg__.m at line 63, column 4 error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/semilogx.m at line 32, column 18
error:   /Users/lukas/OCTAVE/test.m at line 62, column 1

even with the simplified m-file below.

I tried
        clear all
        close all
        axes
        plot(1:10)
It worked for the first time, from the second on I got:

error: invalid use of script in index expression
error: called from:
error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/gca.m at line 45, column 9 error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/__plt_get_axis_arg__.m at line 63, column 4 error: /Applications/Octave/Octave.app/Contents/Resources/share/ octave/3.2.0/m/plot/plot.m at line 178, column 18


Are there any other files than .octaveverc to delete?

Regards,
Lukas





SIMPLIFIED M-FILE:

% Heat Exchanger


% Tabula Rasa
clear all;
close all;
clc;


% Physical Parameters
m_star_1 = 0.5;  % kg/s
m_star_2 = 0.2;  % kg/s
V_1 = 0.01;      % m^3
V_2 = 0.02;      % m^3

rho = 1000;      % kg/m^3
c = 4200;        % J/(kg K)
Ar = 2;          % m^2
k = 2000;        % W/(m^2 K)


% Control-Oriented Parameters
tau_1 = rho * V_1 * c / ( m_star_1 * c  +  k * Ar );
tau_2 = rho * V_2 * c / ( m_star_2 * c  +  k * Ar );

sigma_1 = k * Ar / ( m_star_1 * c  +  k * Ar );
sigma_2 = k * Ar / ( m_star_2 * c  +  k * Ar );

beta_1 = m_star_1 * c / ( m_star_1 * c  +  k * Ar );
beta_2 = m_star_2 * c / ( m_star_2 * c  +  k * Ar );


% System Matrices
A = [      -1/tau_1    sigma_1/tau_1 ;
      sigma_2/tau_2         -1/tau_2 ];

B = [ beta_1/tau_1               0 ;
                 0    beta_2/tau_2 ];

C = [ 1    0 ;
      0    1 ];

D = [ 0    0 ;
      0    0 ];


% Singular Value Plot
w = logspace(-3, 1, 1000);   % rad/s

for k = 1 : size(w, 2)
        
        % Frequency Response Matrix
        P = C * inv(i * w(k) * eye(size(A))  -  A) * B  +  D;
        
        % Singular Value Decomposition
        sigma = svd(P);
        sigma_max(k) = max(sigma);
        sigma_min(k) = min(sigma);
end

figure(1)
semilogx(w, 20*log10(sigma_max), w, 20*log10(sigma_min))
xlabel('Frequency [rad/s]')
ylabel('Singular Values [dB]')
grid on



reply via email to

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