Here I'm trying to plot the error (normalized difference between matrices) against the variable rho. All other variables should remain constant. What I'd really like to do is store rho as a separate vector and store values for the error as they're being calculated in each loop.
Any ideas?
%Variables:
%MatrixGen.m: p,q - matrix size, rho- percentage complete, r - rank
%NuclearNorm.m : Zincomplete
clear
p=10; q=10;
r=2;
for rho=0.1:0.3:0.9;
[Ztrue, Zincomplete] = MatrixGen(p,q,r,rho)
tic
[Zreconstructed] = NuclearNorm(Zincomplete)
toc
Error= norm(Ztrue-Zreconstructed, 'fro')
hold on
plot (rho, Error)
end