MATLAB: How to correct the following code that renders the error message: “Undefined function ‘portvrisk’ for input arguments of type ‘double’.

financialportvriskvalue at risk

Attempts at troubleshooting financial function portvrisk
  1. After my code failed to work and returned the same error message, I cut and pasted the following code in the command window. It returned the same error message from the Matlab documentation which is also not working. It leads me to believe there may be an error in the pre-defined function.
  2. No add-on products're being used
PortReturn = [0.29/100;0.30/100];
PortRisk = [3.08/100;3.15/100];
RiskThreshold = 0.10;
PortValue = [1000000000;500000000];
ValueAtRisk = portvrisk(PortReturn,PortRisk, RiskThreshold,PortValue)

Best Answer

portvrisk requires the Financial Toolbox be licensed and installed.