Matlab Datatip Struct - How do I use it!?

조회 수: 19 (최근 30일)
Plum
Plum 2025년 11월 25일 2:49
편집: Stephen23 2025년 11월 25일 4:50
I have a plot of an oscillating and decaying sinusoidal wave. I need to find the peaks and valleys using the data tips, then extract the x and y coordinates of each of them so that I can do some further math. I first turned datacursormode on, then clicked each peak and valley. If I hit "extract current data tip to workspace", it seems to extract all data tips, and into a struct. I eventually figured out how to get it to display the coordinates (var.position) which then shows every 2 x 1 array of coordinates, separately but not labelled (probably because none of the data tips had any sort of label or name) and seemingly in a random order. But I cannot access the numbers I need. My next step would want to be to create vectors for each of x and y, because I do know how to access individual elements of a vector. But I have been given instructions to specifically use the datatips to get the coordinates, and it doesn't sound like I can just write down the numbers that the datatips show while on the graph. So how do I get what I need?

답변 (1개)

Stephen23
Stephen23 2025년 11월 25일 4:49
편집: Stephen23 2025년 11월 25일 4:50

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by