Quantcast
Viewing all articles
Browse latest Browse all 41

Make some rows null and to create flag column using a condition

Dear Experts,

I have this question in MATLAB, If suppose I have a table with Stock_code, Date and Close price values like in below example, then, I will have to create additional columns like 'count', 'close*1.5' and 'Flag'. I have already created a column for count. Kindly help me, how to create a 'close*1.5' column values, it should start from 3rd row only in each stock and also a Flag variable, If close price is missing then Flag is 'No' , If close price is available then 'Yes'. How to create column 5 and 6 in MATLAB(I have given below table as example).Kindly advise.

Stock_code Date close count close*1.5 Flag
  10 25-Mar-17 8.3 1 Yes
  10 26-Mar-17 9.5 2 Yes
  10 27-Mar-17 3 0 No
  10 28-Mar-17 10.2 4 15.3 Yes
  10 29-Mar-17 10.3 5 15.45 Yes
  10 30-Mar-17 9.9 6 14.85 Yes
  11 25-Mar-17 8.6 1 Yes
  11 26-Mar-17 9.2 2 Yes
  11 27-Mar-17 9.5 3 14.25 Yes
  11 28-Mar-17 4 0 No
  11 29-Mar-17 5 0 No
  11 30-Mar-17 10.7 6 16.05 Yes

Viewing all articles
Browse latest Browse all 41

Trending Articles