3d implicit function plot with the sign function
Show older comments
Dear all,
I need help with plotting the set of probability functions which have constant entropy:
I've tried to define a partial function
equal to NaN whenever
and then use fimplicit3 to plot this -- but failed.
Instead, I've attempted to use the sign function instead:
.
So,
.
When plotting this function, I obtained plots that just do not look right to me.
After failing for a long time, I finally come to believe that there's a problem with plotting the sign function. Here's my code:
syms x y z
f = @(x,y,z) (-0.1+(sign(x+y+z-1).*sign(x+y+z-1)));
interval = [0 1 0 1 0 1];
fimplicit3(f,interval)
xlabel('P(\omega_1)')
ylabel('P(\omega_2)')
zlabel('P(\omega_3)')
hold off
view([132 48])
This is an implicity plot of all
such that
. There shouldn't be any such numbers.
However, Matlab plots some such values.
Could someone please help. All help much appreciated.
Best,
Juergen
Answers (1)
Torsten
on 15 Feb 2023
0 votes
MATLAB assumes that the function f you provide is continuous. For x+y+z =1, the function returns -0.1, for all other triples for x,y and z, it returns 0.9. Thus MATLAB assumes that "very near" to x+y+z=1, there is the surface with f(x,y,z) = 0.
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!