Adding number to an array

8 Ansichten (letzte 30 Tage)
Chris Dan
Chris Dan am 10 Jun. 2020
Beantwortet: madhan ravi am 10 Jun. 2020
Hello
I have an array r1 = [0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9]. I want to insert the variable c into this array. c =1
So at the end, the array should become
r1 = [0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 1]..
or if c = 0.5, then array becomes
r1 = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9].
I want to insert the value c into the array r1.
I looked up this link
but concatenating is not working for me.
Does any one know

Akzeptierte Antwort

madhan ravi
madhan ravi am 10 Jun. 2020
Wanted = sort([r1, c])

Weitere Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by