- #1
senthya
- 2
- 0
Homework Statement
you are given a vector y construct a MATLAB script program to shift all element of y left by ( n ) position..
I mean if y=[1 5 6 9 3]
and n=2
by apply this program on y we have :
y=[3 1 5 6 9]
The Attempt at a Solution
this is my Attempt to solve this problem :
x=input('x= ')
n=input('n= ')
for i=1:n
x(i)=1;
while x(i)+1<=n
x(i)=x(i)+1;
end
end
x
I know its wrong ..to that reason i need your help..