Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

create a vector with specified entries

3 vues (au cours des 30 derniers jours)
Matheus
Matheus le 29 Nov 2014
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (1)

Star Strider
Star Strider le 29 Nov 2014
Use the zeros and ones funcitons, respectively:
x = zeros(1,100);
y = h*ones(1,100);

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by