Make a vector for given number.

How can I make a vector for given number end with 9.
For example I want 5 elements.
A = [7 8 8 9 9]
For 4 elements
B=[8 8 9 9]
and so on.
Hope you can help me

回答 (1 件)

Image Analyst
Image Analyst 2018 年 11 月 25 日

0 投票

Try this
vec = [vec, 9];
Adapt for different vector names.

カテゴリ

ヘルプ センター および File ExchangeMultidimensional Arrays についてさらに検索

質問済み:

2018 年 11 月 25 日

回答済み:

2018 年 11 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by