How to test non-linearity of array (1x256 double)?

1 view (last 30 days)
Can i check whether my array of size 1x256 double is a non linear or not.?
For example i have a following array A:
20 40 26 136 51 199 196 29 112 43 201 99 227 241 106 151 220 12 23 215
whether A is non linear or not? how to test the non linearity of A?
  1 Comment
KSSV
KSSV on 25 Oct 2020
What do you mean by non-linearity?
Fit a striaght line and get the regression between the data..is that okay with you?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 25 Oct 2020
Any vector which is not either constant or monotonically increasing or monotonically decreasing, cannot be linear.
If you consider a linear equation y = a*x + b, and take the derivative of it, y' = a, and take the derivative of that, y'' = 0 . So if you take diff(diff()) of your vector and the result is not 0 to within round-off error then you do not have a linear vector.

More Answers (0)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!