I want to add a definite fixed intervals between my input data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ANIL N R
am 30 Mär. 2022
Beantwortet: ANIL N R
am 31 Mär. 2022
input
distance =[0 0 5 10 15 20];
I want to add 1m interval between the each inputs, if applicable.
Output
0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .
0 Kommentare
Akzeptierte Antwort
Arif Hoq
am 30 Mär. 2022
try this:
distance =[0 0 5 10 15 20];
C=cell(6,1);
for i=1:length(distance)-1
C{i}= distance(i):1:distance(i+1);
end
output=[C{:}];
output=[output(1) unique(output)]
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Interpolating Gridded Data 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!