Programmer Question
This question is related to http://stackoverflow.com/questions/3071558/matlab-how-to-merge-data
how to use the FIND
function with IF
statement? e.g. if I have this data:
20 10 1
20 11 1
20 15 1
23 10 1
23 10 1
23 12 0
Rule 1:
Data of column 3 must be 1.
Rule 2:
If n
is the current index of column 1, if n
equal n-1
(20=20) of column 1, data of column 2 of index n and n-1 is merged.
20 21 0
20 15 0
20 0 0
23 20 0
23 0 0
23 12 0
fid=fopen('data.txt');
A=textscan(fid,'%f%f%f');
code=A{1};
time=A{2};
mark=A{3};
fclose(fid);
Find the answer here
No comments:
Post a Comment