help-octave
[Top][All Lists]
Advanced

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

Problem while using waitforbuttonpress function


From: Giovanni Parodi
Subject: Problem while using waitforbuttonpress function
Date: Thu, 03 Jun 2010 11:14:41 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.8) Gecko/20100216 Lightning/1.0b1 Thunderbird/3.0.2

Good morning,
I'm trying to use the waitforbuttonpress method in my .m file but it seems that it doesn't work (Octave-3.2.4).
My code:

        % This is a function that display a figure with 2 subplot
        viewImage();

            CRTR = '?';

            while ( ~((CRTR=='y') || (CRTR=='n')) )

                w = 0;
               
                fprintf('TEST_0\n ');
               
                % filtro via l'evento legato a click del mouse e reagisco
                % solamente a input da tastiera
                while(w ==0)
                    fprintf('TEST_1\n ');
                    w = waitforbuttonpress();
               
                    fprintf('TEST_2\n ');
                    CRTR = get(gcf, 'CurrentCharacter');
                end
            end

The output shows the following text:
TEST0
TEST1
warning: implicit conversion from real matrix to real scalar
warning: implicit conversion from real matrix to real scalar
warning: implicit conversion from real matrix to real scalar
warning: implicit conversion from real matrix to real scalar
and if I press a button nothing happens (and the string TEST_2 never appears).
I don't understand the meaning of the warning, the same code in Matlab works fine.
Do ypu have any hint/reference to documebntation? I found nothing similar on the web, searching through Google.
Many thanks
Giovanni



--
Giovanni Parodi
Firmware Engineer
Divisione Automazione, Logistica e Trasporti, Laboratorio LHW

ElsagDatamat S.p.A.
Via Puccini 2 16154 Genova


reply via email to

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