How do i shift values?

function sampleReadings = ShiftValues(sampleReadings)
% sampleReadings: Array containing 3 elements
% Write three statements to shift the sampleReadings array contents 1 position to the left
% Note: The rightmost element should be -1
sampleReadings =
end

3 comentarios

Cedric
Cedric el 2 de Oct. de 2017
What have you tried so far?
Blair Hall
Blair Hall el 2 de Oct. de 2017
I haven't
Jan
Jan el 2 de Oct. de 2017
Editada: Jan el 2 de Oct. de 2017
@Blair: You did not try anything but ask the forum? Why? Do you want us to learn Matlab? Please stop this. If you do not even try to solve your homework by your own, it is a waste of time to ask the forum for help - of your time and the time of the ones who are willing to help you.

Iniciar sesión para comentar.

Respuestas (1)

Star Strider
Star Strider el 2 de Oct. de 2017

0 votos

If ‘sampleReadings’ is always going to contain only three elements, address the last two elements of the existing ‘sampleReadings’ vector and concatenate -1 to the end.
That’s my best guess. I don’t know what you’re supposed to do, or what you started with.

Preguntada:

el 2 de Oct. de 2017

Editada:

Jan
el 2 de Oct. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by