Info

此问题已关闭。 请重新打开它进行编辑或回答。

create a vector with specified entries

5 次查看(过去 30 天)
Matheus
Matheus 2014-11-29
关闭: MATLAB Answer Bot 2021-8-20
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
Use the zeros and ones funcitons, respectively:
x = zeros(1,100);
y = h*ones(1,100);

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by