简体   繁体   中英

Finding global maximum in matlab

Can any body know how to find the global maximum of a signal in matlab.

Any help will be highly appreciated. Thanks

assuming your signal is a vector x, just do

[max_value, index_number] = max(x)

max_value will be the biggest value and index_number will be the index number of your original vector x.

the biggest peak is not always the maximum it can always be the first or last element in the vector (if of curse you really mean the biggest peak and not maximum of function )

[~,indexes]=findpeaks(x,'SORTSTR','descend');
i=indexes(1);

This is a very bad question as not enough information has been provided by the OP. but fminbnd() might be a good option to look into:

clear; close all; clc;

myFun = @(x) -min(sin(x), x^2);

[x1, y1] = fminbnd(myFun, -1, 2);

You can use isoutlier function like this example

A = [57 59 60 100 59 58 57 58 300 61 62 60 62 58 57];
TF = isoutlier(A)

If you want only specific parts, you can divide your vector as isoutlier(A(5:25)) or similar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM