create a vector with specified entries

Hello, I need to create the following vectors:
x=[0 0 0 ...0] and y=[h h h...h]
where h is a constant that I declared. Both vectors need to have a length of 100

回答 (1 件)

Star Strider
Star Strider 2014 年 11 月 29 日

0 投票

Use the zeros and ones funcitons, respectively:
x = zeros(1,100);
y = h*ones(1,100);

この質問は閉じられています。

タグ

質問済み:

2014 年 11 月 29 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by