need help in making good figure using surf and meshgrid

1 次查看(过去 30 天)
Here is my problem ! I am not able to get good figure out of it so please help !
I have error matrix 17 by 100. 17 is number % of missing sample from signal which varies from 5:5:85 (5 % to 85%). 100 is number of iteration.
so column 1 row 1 represents error vector for 5% missing samples..so my solution is getting converge in 3 values..same happens for 10%..in 15%...it converge say 5 values....when i say converge i mean that from 3rd value till 100 its all 0 in vector..
so iteration is 1:1:100 for all missingsamples..
Now i create
x=5:5:85;y=1:1:100; [X Y]=meshgrid(x,y); surf(X,Y,errormatrix)
Now since i have lot of zeros in my matrix i am not getting good figure..and second point which bothers me i just want to plot till point where it becomes 0 say i want to plot 3 iteration and 3 error values becoz 3 is 0..after that all are zero...
also is it possible to get the whole thing in middle it looks better, peaks look more better
ThANKS

回答(2 个)

Andrew Newell
Andrew Newell 2011-5-15
Did you try
imagesc(x,y,errormatrix)
as I suggested in your previous post? By choosing a suitable colormap and values for caxis, you could make the zero values white or a very light color. Another thing to try is hist3.

Walter Roberson
Walter Roberson 2011-5-16
Replace the 0's with nan:
errormatrix(errormatrix==0) = nan;
Then do the surf()
By the way, for any version of MATLAB released within the last several years, you can replace
x=5:5:85;y=1:1:100; [X Y]=meshgrid(x,y); surf(X,Y,errormatrix)
by
x=5:5:85;y=1:1:100; surf(x,y,errormatrix)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by