MATLAB: Riskless assets and Financial toolbox

modern portfolio theoryvariance covariance matrix

Hi, I'm trying to construct an optimized portfolio with 5 assets, one of which being a risk free us interbank rate.
I have already constructed a portfolio of the risky assets using frontcon. I have minimum allocations set for each of the 4 risky assets. I took the average of portfolio weights that produce a portfolio risk under 3.3%.
How to I incorporate the risky portfolio into a final portfolio that includes the risk-free asset? I feel like I have not correctly accounted for the other port optimization features in Matlab, but am also not sure how to build in the allocation constraints for the risky assets, especially since I have only forecasted the variance covariance matrix for the risky assets.
Thanks!
–Edit: Attached is the code that I'm using
%Set CONSTRAINT CONDITITONS for 2005-2010 and defaults for Efficient
%Portfolio Estimation (frontcon)
AB1=[0.10375083 0.006820083 0.171937234 0.003411251]
AB2=[0.09746352 0.006573773 0.157316298 0.003219355]
AB3=[0.099026445 0.005835995 0.144081934 0.003175635]
AB4=[0.094700297 0.005734776 0.117213615 0.003325538]
AB5=[0.090528613 0.005708664 0.117541015 0.003486458]
AB6=[0.090044181 0.005225695 0.112304033 0.004449439]
AssetMax=[1 1 1 1]
NumPorts=1000
%For Each Year
%1) Run DCC MV GARCH Process for each year to get the Variance-Covariance Matrix
%2) Set Asset Bounds According to Constraint Conditions
%3) Estimate the Efficient Portfolio for Risky Assets Using Frontcon
%2005
[parameters, loglikelihood, Ht, Qt, stdresid, likelihoods, stderrors, A,B, jointscores]=dcc_mvgarch(R1,1,1,1,1);
VCM1=Ht(:,:,966)
PortReturn=[]
AssetBounds=AB1
AssetBounds(2,:)=AssetMax
ExpCovariance=VCM1
ExpReturn=D1(966,:)
[PortRisk, PortReturn, PortWts] = frontcon(ExpReturn, ExpCovariance, NumPorts, PortReturn, AssetBounds)
Port2005=PortRisk
Port2005(:,2:5)=PortWts
if mean(Port2005(:,1))<.033
W2005 = mean(Port2005(:,2:5));
end
Where VCM is the variance covariance matrix AB1-6 are asset bounds specific to each year that I'm estimating a portfolio for. W is the average portfolio weights that produce a standard deviation less than .033.
Unfortunately I only have access to 7.0.
—Thanks again

Best Answer

This link may be of some help Optimal Risky Portfolio Example
Post what you've done so far for further help.
EDIT
Then you can call portalloc rigth after frontcon, as outlined in the example from the link I posted, supplying an average risk free rate.
Doesn't come into my mind how to implement a stochastic risk-free rate into a mean-variance framework.
The suggestion by David also considers a scalar risk free rate.