Reduce the size of a vector
46 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Rafael Freire
il 4 Giu 2014
Risposto: Rafael Freire
il 5 Giu 2014
I wanto to convert a vector 1x45000 to a vector 1x36000 and a vector of 1x27000 to a vector 1x36000 How can I do it?
2 Commenti
Roger Wohlwend
il 5 Giu 2014
I don't understand the question. You want to convert a vector with 45'000 elements to one with 36'000 elements? What does that mean? I suppose you don't want to delete 9'000 elements?
Risposta accettata
Più risposte (1)
David Sanchez
il 5 Giu 2014
vect_45 = rand(1,45000); % your 1x45000 array
vect_36 = vect_45(:,1:36000);
vect_27 = rand(1,27000); % your 1x27000 array
vect_36_b = [vect_27 zeros(1,9000)]; % you have to add elements to fill the gaps between 27000 and 36000, I added zeros
0 Commenti
Vedere anche
Categorie
Scopri di più su Data Type Conversion 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!