how to form a new vector from an old one with a loop
Ältere Kommentare anzeigen
Dear All, I hope that you are all well
I hope I will be able to explain my problem as good as it should.
I have three one column vector, the vectors size is m.
I would like to build a new vector let say we name it VectorA, this vector contain the 1st value of Vector 1 and it will repeat the picking the value at a regular step let say 30 from vector until the end.
Then the vector B it will take the second value from the vector 1 and with the same concept and repeated steps.
the number of vectors created equal to the Number of step used to pick values.
if the size of original vector is not devised on the step chosen, the code need to fill the vector constructed with zeros.
2 Kommentare
Rik
am 20 Aug. 2021
What have you tried, and can you give a small example?
Mohammed Lamine Mekhalfia
am 20 Aug. 2021
Antworten (0)
Kategorien
Mehr zu Variables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!