Plot a function with respect to another function
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saeid Hajizadeh
el 11 de Mzo. de 2014
Comentada: Walter Roberson
el 12 de Mzo. de 2014
Dear guys,
I have two functions, each function of two variables x,y; namely z1 = f1(x,y) and z2 = f2(x,y) and want to plot z1 vs z2. The functions are below:
0 <= x,y <= 1;
z1 = -(1-x) .* ( (y./(1-x)).*(log((y./(1-x)))) + (1-((y./(1-x)))).*(log(1-((y./(1-x))))) ) /log(2);
z2 = -(1-y) .* ( (x./(1-y)).*(log((x./(1-y)))) + (1-((x./(1-y)))).*(log(1-((x./(1-y))))) ) /log(2);
0 comentarios
Respuesta aceptada
Walter Roberson
el 11 de Mzo. de 2014
Assign values to x and y, do the calculations producing z1 and z2, then
plot(z1, z2)
7 comentarios
Saeid Hajizadeh
el 12 de Mzo. de 2014
Editada: Saeid Hajizadeh
el 12 de Mzo. de 2014
Walter Roberson
el 12 de Mzo. de 2014
Also if y = 0 then you multiply 0 by log(0) which is going to give you NaN.
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!