logarithmic plot function failure

1 visualización (últimos 30 días)
iMatten
iMatten el 3 de En. de 2019
Comentada: iMatten el 4 de En. de 2019
Hello,
After reading a certain article connected to pseudocoloring a grey image with HSI map color I wanted to try it on my own but the result didnt meet my expectations, the problem is logarithmic function. Article states that impying these formulas:
I should get plot:
my code:
map = zeros(256,3);
x = 1:256;
map(:,1) = 1/2 - 1/2*sqrt(1 - (x/256).*(x/256));
map(:,2) = 0.8;
map(:,3) = log(((x+1)/(256+1)));
figure;plot(x,map);

Respuestas (1)

Jan
Jan el 4 de En. de 2019
Where do you see a failure? If the argument of the logarithm is smaller then e (which is exp(1)), the output must be negative. In the posted diagram I (the blue line) starts at 0, while this is not possible for:
log((x+1) / (256 + 1))
So the actuial problem is, that your expectations do not match the posted formula.
  1 comentario
iMatten
iMatten el 4 de En. de 2019
yes, I agree with that. I was wondering if there is any trouble with formula or I was doing something wrong.
I hadn't thought that might be a mistake in this article. Then what formula for "I: component that would be?

Iniciar sesión para comentar.

Categorías

Más información sobre Blue en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by