MATLAB: Plot only for positive y

MATLABplot

I have
plot(x,y)
hold on
plot(x,z)
hold on
plot(x,w)
I need to have a plot for only positive y and z. I try to write
ylim([0,yMax])
But I do not know how to set for yMax. Please advise.

Best Answer

NEW ANSWER
ylim([0 inf]) %Will automatically compute the limit where "inf" is used
OLD ANSWER
ylim([0, max([y(:); z(:); w(:)]))
%will plot positive values of y axis from 0 to the maximum of either your y or z or w values.
Related Question