- #1
loveinla
- 11
- 0
Hi--I have two vectors ##x=(x_1, x_2, ..., x_n)## and ##y=(y_1, y_2, ..., y_n)##.
Now I want them to be multiplied in the following way:
for each ##i=1,2,..,n##, I need ##x_i*y_{i-1}-y_n##.
Can anyone help me on how to code this in Matlab?
BTW, I also want to input the length of the two vectors ##n## at the very beginning of the program. What do I need to do in order ensure the lengths of vectors ##x## and ##y## are the ##n## I specified as an input?
Thanks in advance!
Now I want them to be multiplied in the following way:
for each ##i=1,2,..,n##, I need ##x_i*y_{i-1}-y_n##.
Can anyone help me on how to code this in Matlab?
BTW, I also want to input the length of the two vectors ##n## at the very beginning of the program. What do I need to do in order ensure the lengths of vectors ##x## and ##y## are the ##n## I specified as an input?
Thanks in advance!