MATLAB Answers

interaction with data cursor in data inspector

3 views (last 30 days)
fangfines on 20 Aug 2020
Commented: fangfines on 21 Aug 2020
say i have the following data in time series:
t1: v1, (x1a, x1b, x1c, x1d...), (y1a, y1b, y1c, y1d...)
t2: v2, (x2a, x2b, x2c, x2d...), (y2a, y2b, y2c, y2d...)
t3: v3, (x3a, x3b, x3c, x3d...), (y3a, y3b, y3c, y3d...)
ti: vi, (xia, xib, xic, xid...), (yia, yib, yic, yid...)
tn: vn, (xna, xnb, xnc, xnd...), (yna, ynb, ync, ynd...)
i can get a time plot of (tn,vn) in data inspector, buy when i drag the data cursor to (ti,vi), is that possible i get a sync xy plot of (xi....,yi....)?
i think if i could access the position api of the data cursor, then it is possible to set the xy data of the xyplot.
but if this is possible and could this run as a interactive mode (e.g., the api could run background then when i release to drag the cursor, the xyplot automatic sync to that (xi...,yi...) at (ti) )?
thanks very much


Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 20 Aug 2020
It sounds like you want to have have two plots, one time-domain plot that you interact with using the data cursor, and one x-y plot that gets updated based on where the data cursor is currently located.
I haven't personally tried it, but you could possibly create a custom UpdateFcn callback when calling "datacursormode", pass it the handles to the x-y plot that you need, and have that update the x-y plot based on the currently clicked position. It would also be defining what the data tip would look like, but that's not the main focus here.

  1 Comment

fangfines on 21 Aug 2020
thanks very much for the suggustion.
its looks like a promising workaround if i do this in normal matlab plot.
anyway, i still wish to find a solution in simulink data inspector(, which gives a more convenient ui for my analysis.
many thxs again

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!