match time stamps index

Technical Source
1 min readMar 18, 2023

--

hi i have two vectors diffrent lengths with diffrent values

i want to match closest index in one vector to other

example :

v1 =

[1610759986514 1610759986549 1610759986583 1610759986618 ]

v2= [ 1610759986540 1610759986589]

so result should be in vector 1 match index 2,3 to v2 index 1,2 (time is close enough)

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

format long g
v1 = [1610759986514 1610759986549 1610759986583 1610759986618 ]
v1 = 1×4
1610759986514 1610759986549 1610759986583 1610759986618
v2 = [1610759986540 1610759986589]
v2 = 1×2
1610759986540 1610759986589
interp1(v1, 1:length(v1), v2, 'nearest', 'extrap')
ans = 1×2
2 3
interp1(v2, 1:length(v2), v1, 'nearest', 'extrap')

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet