The circshift function not working.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Giuseppe
am 24 Mär. 2014
Beantwortet: Mischa Kim
am 24 Mär. 2014
I have this code using the idea from this post Vector manipulation by changing order or numbers in a vector. .
xcor = input('Input x coordinates vector transposed.')
%enter the cooordinates [ (numbers spaced) ]'
xcor_p1 = [xcor;xcor(1)]
xcor_p2 = [circshift(xcor_p1,[0 -1])]
e.g If the
xcor = [4 6 2]'
inputed I get
xcor_p1 = [4 6 2 4] '
as I need but Matlab generates
xcor_p2 = [4 6 2 4] '
I need
xcor_p2 = [6 2 4 4]'
as in the case in the with a and b from Vector manipulation by changing order or numbers in a vector. . What has gone wrong here?
0 Kommentare
Akzeptierte Antwort
Mischa Kim
am 24 Mär. 2014
Giuseppe, use
xcor = [4 6 2];
xcor_p1 = [xcor xcor(1)];
xcor_p2 = [circshift(xcor_p1,[0 -1])]'
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!