How to write a pattern for any different values
1 view (last 30 days)
Sorry if my title does not make much sense. Basically, I want to use the strfind command on the variable X. I've attached it in an excel file. I want to simply find the places that the variables changes from one number to another, but I'm not exactly sure how to write this pattern. How should I do this?
Steve Eddins on 14 Oct 2020
T = readtable('matlab_question2.csv');
idx = find(diff(T.x))
The first line reads your CSV file into a table that contains the variable x.
The function diff computes the differences between adjacent elements of its input.
The function find then returns the indices where the adjacent element differences are nonzero. These are the locations where the values change. For example: