adding a number to an array
Afficher commentaires plus anciens
I am trying to create two arrays - one for time, which represents all of the x values for the graph, and one for y, which represents the corresponding y values for each time. The arrays need to be the same length. One section of the graph is a constant, and I am unable to get the y array to be the same length as x. For example, if x is [1 2 3 4 5], the problem I'm running into is that I need y to be [1 1 1 1 1] but can only set the code to be [1, 1].
4 commentaires
David Hill
le 12 Sep 2019
Please provide the code example. It is unclear to me what your problem is with the array lengths.
Emma
le 12 Sep 2019
Modifié(e) : per isakson
le 12 Sep 2019
Walter Roberson
le 12 Sep 2019
e = [e, repmat(s, 1, length(tsustain))]
Emma
le 12 Sep 2019
Réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!