A very simple question about a column vector creation
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Taner Cokyasar
il 9 Lug 2016
Commentato: Star Strider
il 9 Lug 2016
I am an extra beginner MATLAB user. There is a 1:m command to create a 1 2 .... m row matrix. However, I couldn't find how to create a column vector as 12: 13-m. I mean (assume m=5):
12
11
10
9
8
0 Commenti
Risposta accettata
Star Strider
il 9 Lug 2016
If you want to decrement a vector, begin with the highest number and increment by a negative value to the desired end value. Here, the decrement value is -1:
m = 5;
v = [12: -1: m]'
v =
12
11
10
9
8
7
6
5
Is this what you want to do?
2 Commenti
Star Strider
il 9 Lug 2016
My pleasure.
My apologies for the inaccurate code. I misunderstood your Question.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!