3d graph showing reconstruction error

Question :
I want to plot 3 axis giving me 3d graph ! One axis is error, second is number of iteration, 3rd is % of missing sample
My Conjugate gradient based algorithm is giving me fully reconstructed sample i put in the signal missing samples.
So assuming this is my example
A= signal with missing sample
P=% of missing samples in A
b=reconstructed signal
n=number of iteration
e=error
so i put in signal with 512 samples with 5% missing samples and it takes 20 iteration with say 0.002 as error...
now i will increase the missing part to 10% and it will obviously take more iteration and error may be increase depending on missing samples.
I want to do it from 5% till 70% missing samples...
Looking for your ideas for input
Cheerr
kk

 Réponse acceptée

Andrew Newell
Andrew Newell le 13 Mai 2011
If I understand your question, you have two input variables, P and n, and a result e = e(P,n). So you create a grid of values for P and n using meshgrid, then calculate e for each pair P(i),n(j). If the resulting error is a smooth function of the inputs, you could plot it using
surf(P,n,e)
or use contour. If it's not so smooth, you might prefer to use imagesc.
EDIT: To clarify, you need a loop something like this:
p = 5:5:70;
n = 20:20:200;
[P,N] = meshgrid(p,n);
e = 0*P; % just an initialization
for i=1:numel(P)
e(i) = simulateAndReturnError(P(i),N(i));
end
surf(P,N,e) % or imagesc(p,n,e)

4 commentaires

guj
guj le 14 Mai 2011
Here it goes ! After running simulation i get error results as 1 by 3 vector , when i change parameter i get 1 by 5 vectors they keep on increasing maximum till 1000 values with change of parameter (which i will change 13 times) so my question is
Suppose y is error i am getting after every simulation with number of values less than 1000, so i want to preallocate the vector say y1...which will store value of y after every simulation...so there are 13 simulation...I want to make a matrix of 13 by 1000;
So I have solution which is
error matrix (y1)of 13 by 1000
vector of 13 parameter values....1 by 13
iteration matrix : 1 by 1000 so basically error matrix is what i get after changing parameter 13 times and running 1000 iteration each...
Question 2:
Now I want to plot all three parameters on 3d axis ! so should i do like this
[X,Y]=meshgrid(P,I) where p is parameter vector 1 by 13 and I is 1 by 1000.
surf(X,Y,errormatrix)
Thanks
Andrew Newell
Andrew Newell le 14 Mai 2011
What is question 1?
Andrew Newell
Andrew Newell le 14 Mai 2011
What you plot depends on how you index errormatrix (which is why I provided the code). You should make sure that errormatrix(i,j) corresponds to P(j) and I(i), e.g., errormatrix(100,2) is for 100 iterations and your second parameter. If it's the other way around, use:
surf(X,Y,errormatrix')
guj
guj le 15 Mai 2011
THanks I am able to plot it but stuck with some thing else now ..posted another question in link on using surf and meshgrid

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by