Month = [01 02 03 04 05 06]'; Price = [99 58 94 58 87 91]'; Count = [10 30 20 27 05 04]'; T = table(Month, Price, Count)m = 1 for i = 2:size(T,1) if (T.Price(i) <= T.Price(m)) m = i; end end T(m,'Month')
I have this code that finds the minimum price and tells me which month has the minimum price. However, the answer I am getting is only the 4th month, whereas there is a minimum in the 2nd month as well. How can I get this code to show me all months with the minimum price? How can I store the answer in a vertical vector? Thanks in advance!
Best Answer