3d implicit function plot with the sign function
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Torsten
am 15 Feb. 2023
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.
3 Kommentare
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!