A standard RF generator has a 50 ohm output impedance. When you set it, the displayed power is referred to the nominal load of 50 ohm.
Using the schematic drawn by Ata_sa16 (Thevenin equivalent):
Vin = Vg/2 this is the voltage seen by the load
The RMS power dissipated by it will be, simply:
Pload=Vin^2/R that referred to the internal generator is Pgen=Vg^2/(4R)
Then if you know which power is sent to the nominal load of 50 ohm, let's say Prec0 then you can calculate the generator voltage:
Prec = Vin^2/R ==> Vin = sqrt(Prec0*R)
since Vin = Vg/2 ==> Vg = 2*sqrt(Prec0*R)
So, in Matlab you will have to simulate an ideal generator of voltage Vg with series resistance R=50.
Connecting it to an ideal resistor R=50 ohm you will see the Prec0 you have set. When instead you will connect it to a real receiver the dissipated power will be different, according to the actual impedance of the receiver.
Let's imagine the actual receiver has a resistive impedance Rrec, then
Vrec=Vg*Rrec/(R+Rrec) ==> Vrec= 2*sqrt(Prec0*R)*Rrec/(R+Rrec)
Prec = Vrec^2/Rrec ==> Prec = 4*Prec0*R*Rrec/(R+Rrec)^2