MATLAB: Plot two variables only when a third one has certain value

conditional plotting

Hi
I have 3 variables, Time, Temperature and FC. FC is either 1 or 0. All 3 variables are of the same length.
I want to plot temperature over time but ONLY when FC = 1. Namely I want the Temperature profile over time when FC = 1 and NOT 0.
How can I do it?

Best Answer

plot(Time(FC==1),Temperature(FC==1))
Related Question