Trying to graph a 3 variable probability function

2 Ansichten (letzte 30 Tage)
adr58_1
adr58_1 am 25 Okt. 2019
Beantwortet: darova am 26 Okt. 2019
So I'm trying to Maximize f(x), for f(x) = 1/(3.5a+2.5b+3c+1)
but I'm not interested in the ''trivial'' solutions where a, b or c = 0 etc.. I'm looking for a visual representation to see the maximums
0 < a < 1
0 < b < 1
0 < c < 1
I've tried to create a matrix with 3 columns of probabilites for a,b,c but it seems it will only calculate the f(x) for a=b=c which is quite annoying tbh, does someone know how to do this please...im going crazy over here.. i've also tried meshgrid, surf and other functions but nothing is working...

Antworten (1)

darova
darova am 26 Okt. 2019
Use isosurface to visualize
[a,b,c] = meshgrid(0:0.1:2);
f = 1./(3.5*a+2.5*b+3*c+1);
cla
hold on
for fk = 0 :0.1:1
isosurface(a,b,c,f,fk)
end
hold off

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by