Looking for source code of a MATLAB function

3 次查看(过去 30 天)
I want to better understand the inner workings of the MATLAB findpeaks.m
Is it possbile to get a source for this function?

采纳的回答

Walter Roberson
Walter Roberson 2022-2-14
Read the code ;-)
dbtype findpeaks 1:10
1 function [Ypk,Xpk,Wpk,Ppk] = findpeaks(Yin,varargin) 2 %FINDPEAKS Find local peaks in data 3 % PKS = FINDPEAKS(Y) finds local peaks in the data vector Y. A local peak 4 % is defined as a data sample which is either larger than the two 5 % neighboring samples or is equal to Inf. 6 % 7 % [PKS,LOCS]= FINDPEAKS(Y) also returns the indices LOCS at which the 8 % peaks occur. 9 % 10 % [PKS,LOCS] = FINDPEAKS(Y,X) specifies X as the location vector of data
  3 个评论
John D'Errico
John D'Errico 2022-2-14
The ENTIRE source IS available. All Walter showed you were the first 10 lines. However, nothing stops you from doing the same for the entire code.
Arkady Voloshin
Arkady Voloshin 2022-2-15
Great, thank you both very much, it is very useful.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by