(Again) plots do not appear on the graph
1 view (last 30 days)
I am trying to solve a simple problem. I have a bunch of data in neat little columns. So, if a particular record has the value "Dealer" in it's 'Seller' column, I want that particular record's data to be plotted using blue colored markers and green if the "Seller" column does not have "Dealer" for that particular record.
I hashed out some code, but it is not working. The graph appears, but no plots.
while i < 302
if Seller(i) == "Dealer" % __
plot(year(i), distance(i), '.b') % ___
i = i + 1;
plot(year(i), distance(i), '.r')
i = i + 1;
I have tried using the commands  and  Individually and they seem to be working but the whole thing does not work at all....
My data is very simple table. distance and year are like ===>
But in seperate columns. Note that the 0's at end are there because I just divided all values by 1000.
Peng Li on 11 Apr 2020
Edited: Peng Li on 11 Apr 2020
Without data it’s difficult to tell. You tried set a break point and see if it ever appears any points?
Based on your description I think you prob don’t need a while loop.
plot(year(Seller == “Dealer”), distance(Seller == “Dealer”), '.b');
plot(year(Seller ~= “Dealer”), distance(Seller ~= “Dealer”), '.r');