Only plot values until maximum is reached
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This is my script to plot my radiosonde data:
% Temperature and Dew Point against Pressure
[row,col] = find(max(data(:,8))) maxh = max(data(:,8));
plot(sondedata(:,10),sondedata(:,9),'b-',sondedata(:,4),sondedata(:,9),'r-') set(gca,'YDir','reverse'); grid ylabel('P(mb)') xlabel('T(K)') title('Temperature (red) and Dew Point (blue) against Pressure');
Except I want the [row,col] section to plot values until the balloon reaches it's maximum height, and then plot no more. This doesn't work currently, what can I do?
0 comentarios
Respuestas (1)
Star Strider
el 18 de Dic. de 2014
If you’re just finding the max in one column (column 8 in your code), you can just use the max function with two outputs:
[maxh,row] = max(data(:,8));
then if you only want to plot from 1 to ‘row’ (the index of your maximum height value), specify those indices in your plot call:
ixrng = 1:row;
plot(sondedata(ixrng,10),sondedata(ixrng,9),'b-',sondedata(ixrng,4),sondedata(ixrng,9),'r-')
I don’t have your data and I don’t know how ‘data’ relates to ‘sonedata’ so I’m just guessing here.
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!