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?
Distance walked 3D
Back to basics 19 - character types
Sum of diagonal of a square matrix
Reverse the elements of an array
Generate a NaN...on purpose
Sort complex numbers into complex conjugate pairs
Remove entire row and column in the matrix containing the input values
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