I have a row vector which I have created by repeating the same vector many times and would like to add zeroes onto the vector, so for example if I have a row vector which is 1x306, I need to add a row of 102 zeroes to the rest of the vector to make it 1x408. What would be the easiest way of doing this?

 採用された回答

madhan ravi
madhan ravi 2019 年 5 月 18 日

0 投票

vector = [vector,zeros(1,102)]

2 件のコメント

Hollis Williams
Hollis Williams 2019 年 5 月 18 日
Something else I am attempting, let me know if I am not explaining this properly, but say I have a column vector of size 1x300, corresponding to 100 1x3 vectors all in one column. I then have 3 matrices A, B and C which are all of size 3x100 each corresponding to 100 vectors in an array. I need to take the first vector from the column and multiply it with the first vector from the array A to get a first entry in a new column vector, then multiply it with the first vector from B for the second entry and multiply it with the first vector from C for the third entry.
I would then epeat this with all the vectors to get a new 1x300 column vector (this corresponds to converting to a new coordinate system I have created). Let me know if that doesn't make sense.
madhan ravi
madhan ravi 2019 年 5 月 18 日
編集済み: madhan ravi 2019 年 5 月 18 日
By the way how is this related to the original question you asked???
"Adding Zeroes to a Vector"
"I have a row vector which I have created by repeating the same vector many times and would like to add zeroes onto the vector, so for example if I have a row vector which is 1x306, I need to add a row of 102 zeroes to the rest of the vector to make it 1x408. What would be the easiest way of doing this?"
No , your explanation doesn't even make sense. Post it as a separate question.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

タグ

質問済み:

2019 年 5 月 18 日

編集済み:

2019 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by