I need help programming an extremely basic matlab assignment. The assignment is that you input a vector of 4 numbers (A,B,C,D) and the program spits out a new vector (|A-B|,|B-C|,|C-D|,|D-A|). I want to see this process iterated over again how many times I specify.

Also I would like the code for 3 vectors (A,B,C) and the result (|A-B|,|B-C|,|C-A|)

And if possible a vector of size N (A,B,C...An, Bn ...) and the process for that.

Lastly, I would like to see the results with random numbers. Such as (1,2,6,8) (2,4,6,10)

The program will "end" either in a string of 0s e.g. (1,1,1,1) -> (|1-1|,|1-1|,|1-1|,|1-1|) -> (0,0,0,0)

or the program "ends" with an infinite loop e.g. (1,0,1) -> (1,1,0) -> (0,1,1) -> (1,0,1) (infinite loop repeats)

If the number of processes is large, I would like a number of times it takes to get to all 0s or a "cycle" for our (A,B,C,D) case our (A,B,C) case, and possibly our (A,B,C...An, Bn...) case for a vector of size "n"

We are only working with the natural numbers for values of A,B,C,D. NOT the reals, irrationals, complex numbers etc...

Subject | Mathematics |

Due By (Pacific Time) | 01/19/2015 12:00 am |

Tutor | Rating |
---|---|

pallavi Chat Now! |
out of 1971 reviews More.. |

amosmm Chat Now! |
out of 766 reviews More.. |

PhyzKyd Chat Now! |
out of 1164 reviews More.. |

rajdeep77 Chat Now! |
out of 721 reviews More.. |

sctys Chat Now! |
out of 1600 reviews More.. |

sharadgreen Chat Now! |
out of 770 reviews More.. |

topnotcher Chat Now! |
out of 766 reviews More.. |

XXXIAO Chat Now! |
out of 680 reviews More.. |