Filter löschen
Filter löschen

Assigning count values to the column of a matrix

3 Ansichten (letzte 30 Tage)
Iremsu Savas
Iremsu Savas am 27 Jan. 2019
Beantwortet: Stephen23 am 27 Jan. 2019
Hello,
I have a matrix A with the size 29x3 and I want to fill third column with the numbers from 29(the max lenght) to 1.
Is there a possible way to do it without using loops?
Regards

Akzeptierte Antwort

Stephen23
Stephen23 am 27 Jan. 2019
Either one of these, depending on the order that you want:
A(:,3) = 1:29
A(:,3) = 29:-1:1

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by