check if an array is equispaced
이전 댓글 표시
I am given a vector of numbers and I have to check if this vector has its samples equispaced or not. How can I do it without using fors?
채택된 답변
추가 답변 (1개)
>> v = [1,2,3,4,5,6,7];
>> x = ~any(diff(v,2))
x = 1
>> v = [1,2,4,4.5,7];
>> x = ~any(diff(v,2))
x = 0
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!