Reconstruct a compressed vector based on another one with equal space entities
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
assuming I have a Vector of Values and a corresponding Position Vector with constant steps of 250:
VaVector(1,20,-4,23,NaN,NaN,NaN,6,3,NaN,7,-23);
PosVector(2000,2250,2500,2750,3000,3250,3500,3750,4000,4250,4500,4750);
However I have the compressed Vectors with deleted NAN, so I have
VaVector_comp(1,20,-4,23,6,3,7,-23);
PosVector_comp(2000,2250,2500,2750,3750,4000,4500,4750);
How can I reconstruct the VaVector & PosVector? Please note, my example here contains only 12 Values, for simplification (my real compressed Vector contains >5000)
Thank you
Chris
0 Kommentare
Akzeptierte Antwort
Stephen23
am 5 Mär. 2025
VC = [1,20,-4,23,6,3,7,-23]
PC = [2000,2250,2500,2750,3750,4000,4500,4750]
PV = PC(1):250:PC(end)
VV = nan(1,numel(PV));
VV(ismember(PV,PC)) = VC
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Mathematics and Optimization 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!