Determine whether the vector is symmetric or not (vector could be even or odd in length).
x = [1 2 3 3 2 1] is symmetric
x = [1 2 3 4 3 2 1] is symmetric as well!
x = [-1 -2 -3 3 2 1] is not symmetric
Case #3 is not symmetric...please check.
I fixed the wording.
Why the vector from "Test Suite" "Test 3" is symmetric?
x = [-1 0 0 1];
y_correct = 1; %% WHY 1?
I updated test case #3.
Include a test case where first and last are same, but ones in middle aren't (say [1 2 4 3 5 2 1])
I need to learn more.
What if you update the test #3 in test suite?
Get the elements of diagonal and antidiagonal for any m-by-n matrix
Create an index-powered vector
length of a vector
Insert zeros into vector
Moving average (variable kernel length)
Sort complex numbers into complex conjugate pairs
Change the sign of even index entries of the reversed vector
Duplicate a character
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office