How do I restrict my data that needs to be plotted?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have the following code:
xrayslice = 'projection0000.tif';
A = imread(xrayslice, 1);
C = A(60,:);
plot(C)
axis([200,300,0,40000])
xlabel('Pixel');
ylabel('Counts');
title('Projection of X-Ray slice');
Which produces a plot that I want, but only because the axis are restricted. How would I go about producing the same graph but by restricting my data, not my axis? I need my x values to be plotted between 200 and 300 and my y values to be plotted between 0 and 40000. I have tried using
if C<40000
plot(C)
end
but this doesn't work. Any helps or tips would be appreciated. Thank you!
0 Commenti
Risposte (2)
Babak
il 5 Dic 2012
C = A(60,:);
indices = C<40000;
C_in_Range = C(indices);
plot(C_in_Range)
axis([200,300,0,40000])
0 Commenti
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!