Create array with same number
699 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Fadal Sasse
le 10 Août 2017
Réponse apportée : Drue
le 22 Fév 2023
I have this command z=ones(length(x),1) If I want to change (ones) with 2 or 3 what I should do?
0 commentaires
Réponse acceptée
James Tursa
le 14 Sep 2018
Modifié(e) : James Tursa
le 14 Sep 2018
See this link for a discussion of various methods to do this:
The fastest method seems to be
z = zeros(length(x),1) + 2;
0 commentaires
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!