Borrar filtros
Borrar filtros

vector manipulation in matlab

1 visualización (últimos 30 días)
OLUBUKOLA ogunsola
OLUBUKOLA ogunsola el 1 de Jun. de 2016
Comentada: OLUBUKOLA ogunsola el 1 de Jun. de 2016
hi say i have a vector v=[8 4 0 2 8 9 10 11] and i want to add a scaler 'a' ( which could be anything ) i'll write it this way: w=[v,a] ,but in case 'a' occurs more than one time which is not predetermined ( if it was two times it will be w=[v,a,a] ). Say 'n' times , how could i tell matlab to repeat 'a' n times in this format w=[v,a bla bla bla ] thanks

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 1 de Jun. de 2016
w=[v repmat(a,1,n)]

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by