How to get the value and index of the point where the plot ends (Marked by an arrow in image below) and display it? I have used 'find' command but it did not help. Please help me out. .mat file is attached.

1 view (last 30 days)
My code:
clc
clear
close all
a=importdata('Biswarup_rest.mat');
b=a.data;
x=b(32580:36100,1);
[val, idx] = max(abs(x));
plot(abs(x), 'b-', 'LineWidth', 2);
ylim([0.289 0.7])
find(abs(x(end)));

Accepted Answer

KSSV
KSSV on 4 Apr 2017
idx = 1:length(x) ;
hold on
plot(idx(end),abs(x(end)),'*r')

More Answers (0)

Community Treasure Hunt

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

Start Hunting!