Same as in any other device:
P = I(:)*V(:);
Of course, that would give you instantaneous power, which normally is not what you want, so you can then use:
P = mean(P); %to get the desired, average Power, result.
If you want accurate results though, you have to take into account:
- Gate losses are not going to be taken into account, since you would also need Voltage and Current at the gate node (I am assuming you refer to Drain-Source values when you say you have them).
- The results will only be as accurate as your model description, so is to say: if your model does not have an Equivalent Series Resistor, Conduction losses won't be taken into account; if your model does not have a way to make Turning-on and Turning-off times non-cero, Switching losses won't be taken into account.
- This highly depends on how your simulation is done but: Normally, the interesting power loss value is the one at steady state, so is to say, once the circuit capacitors and inductors have reached their stade-state behaviour. So, many times, you would not want to use the full I and V matrices to do the computations, and you would get more accurate results if you dismiss the first values of the simulation (with first I mean the 'n' values untill the signals reach steady state, which could be 90% of the simulation time).