Effacer les filtres
Effacer les filtres

Create a column vector with elements counting down from 200 to 0 in increments of 5

24 vues (au cours des 30 derniers jours)
Mvana
Mvana le 1 Août 2022
Commenté : Stephen23 le 2 Août 2023
I created the vector, C= [200:-5:0] and I git an error that reads, Variable C must have size[41 1]. It is currently of size [1 41]
  1 commentaire
Stephen23
Stephen23 le 2 Août 2023
Note that the square brackets are completely superfluous. The MATLAB approach is simply:
C= 200:-5:0;

Connectez-vous pour commenter.

Réponses (1)

Clay Swackhamer
Clay Swackhamer le 1 Août 2022
Try transposing your output to flip it from a row vector (list of numbers going horizontally) to a column (list of numbers going vertically) like this:
C = C'
  2 commentaires
Mvana
Mvana le 1 Août 2022
Thank you so much, it worked out perfectly
Muhammed
Muhammed le 2 Août 2023
Really helped had the same error
Tx :-)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings 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!

Translated by