How to resize this vector?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
dsp
il 25 Gen 2016
Commentato: Walter Roberson
il 8 Lug 2016
I have a vector A of 64 data points which corresponds to 15.66 cm projection. I need to get a vector B of projection data points of size 64 which corresponds to 0.48 cm in the middle of A. How to get it?
0 Commenti
Risposta accettata
Walter Roberson
il 25 Gen 2016
extract_starting_from = 12.345; %for example
extract_length = 0.48;
orig_X = linspace(0, 15.66, length(A));
new_X = linspace(extract_starting_from, extract_starting_from+extract_length, 64);
extracted_A = interp1(orig_X, A, new_X);
2 Commenti
Walter Roberson
il 8 Lug 2016
? How can you get 4 cm in the middle of something that is only 2 cm long?
'pchip' might be valid for your purposes; 'linear' might be valid. Also specifying 0 instead of 'extrap' might be valid. It depends on what you are modeling.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!