help-octave
[Top][All Lists]
Advanced

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

Re: uint8 undefined in GNU Octave, version 2.1.40 (i386-redhat-linux-gnu


From: Cassia Batista
Subject: Re: uint8 undefined in GNU Octave, version 2.1.40 (i386-redhat-linux-gnu)
Date: Mon, 21 Aug 2006 14:00:19 -0300 (ART)

Ok, thanks. I will do a function like this, but treating double and complex numbers too.

Regards,
Cassia.

"Aquil H. Abdullah" <address@hidden> escreveu:
The uint8() function just converts the elements of an array to 8 bit integers in the range from 0 to 255. You could write your own m file and call it uint8:

function y = uint8(x);
  for i = 1:size(x,1)*size(x,2)
    if x(i) > 255
      x(i) = 255;
    else if x(i) < 0
        x(i) = 0;
    else
      x(i) = x(i);
    end
  end
  y = x
end

You could probably implement this with some bitshifting as well.
On 8/18/06, Cassia Batista <address@hidden> wrote:
Hello,

I'm new in Octave/Matlab programming and I'm porting a source code made in Matlab to Octave, to run in a remote machine. I am having issues when using the uint8 function in GNU Octave, version 2.1.40 (i386-redhat-linux-gnu) . For example:

-------------
octave:1> uint8(2)
error: `uint8' undefined near line 1 column 1
-------------

1)Does anybody know which version of Octave for redhat has defined uint8? Because for testing purposes, I have installed in my XP Windows home computer the GNU Octave, version 2.1.73 (i686-pc-cygwin) and the uint8 is working fine.

2)Since I will have to ask my server administrator to reinstall the octave containing uint8 defined and this could be a little slow, would be great if someone would know other function that transforms a scalar vector in an uint8 scalar vector.

Thanks and regards,
Cassia.


Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!

_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave





--
Aquil H. Abdullah
Interactive Supercomputing
(w) +1 781 419 5051
(m) +1 857 919 2599
address@hidden


O Yahoo! está de cara nova. Venha conferir!
reply via email to

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