help-octave
[Top][All Lists]
Advanced

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

Command order


From: Marco Casali
Subject: Command order
Date: Fri, 15 Jul 2011 09:55:08 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

Dear all,

I'm having a problem with an Octave code.
After the installation of the optim Octave-Forge package in fact
something strange occurs with the plot order.
In practice the command order is not well followed:

minimal example:

function [VTL_mav, VTR_mav, VTL, VTR] = visual_sensor_check(time_mav,
VTL_mav, VTR_mav, VTL, VTR)

% Purpose: manually exclude bad sensors

% Plot1
figure('name',' VTL_mav_taps_sensor_check')
for i=1:size(VTL_mav,2)
    plot(time_mav, VTL_mav(:,i))
    hold all
end
    hold off
    grid on
    xlabel('t [s]')
    ylabel('V [\muV]')
    xlim([0, time_mav(end)+100])
    title('Filtered Data Left Leg')

% Request1
var = input('Would you like to exclude any sensor for the left leg?
[y/n]: ','s');
if strcmpi('y',var) || isempty(var)
    disp('1) Blue, 2) Green, 3) Red, 4) Cyan, 5) Magenta, 6) Yellow, 7)
Black, 8) Blue')
    VTL_excl = input('Insert the number of the sensor to exclude [array
1 x bad_sensors]: ');
    VTL_mav(:,VTL_excl) = [];
    VTL(:,VTL_excl) = [];
end

% Plot2
figure('name',' VTR_mav_taps_sensor_check')
for i=1:size(VTR_mav,2)
    plot(time_mav, VTR_mav(:,i))
    hold all
end
    hold off
    grid on
    xlabel('t [s]')
    ylabel('V [\muV]')
    xlim([0, time_mav(end)+100])
    title('Filtered Data Right Leg')

% Request2
var = input('Would you like to exclude any sensor for the right leg?
[y/n]: ','s');
if strcmpi('y',var) || isempty(var)
    disp('1) Blue, 2) Green, 3) Red, 4) Cyan, 5) Magenta, 6) Yellow, 7)
Black, 8) Blue')
    VTR_excl = input('Insert the number of the sensor to exclude [array
1 x bad_sensors]: ');
    VTR_mav(:,VTR_excl) = [];
    VTR(:,VTR_excl) = [];
end

The "Request1" part of the code is executed before the "Plot1" part and
after this inversion of the command order all the graphs are executed
with this delay, that is that I have to wait for an other figure command
in order to have the PREVIOUS plot.

Can anybody help me in preserving the command oder of my scripts?

Thank you very much,
Marco
-- 
#################################################
Marco Casali

To communicate in a confidential manner:
gpg --keyserver  pool.sks-keyservers.net
KeyID: 0x8EBBA636

O< ASCII ribbon campaign: stop HTML mail
www.asciiribbon.org
#################################################


reply via email to

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