Adding a condition to a built-in function

5 visualizaciones (últimos 30 días)
Abena Amponsah
Abena Amponsah el 2 de Mayo de 2018
Comentada: Abena Amponsah el 8 de Mayo de 2018
I an using the dpss built-in function and want to know if I can add a condition to it such that the sum of the dpss sequence in each row is equal to a specific number? Below is my code:
seq_length = length(pcp);%%pcp has a length of 24
time_halfbandwidth = 6.5;
num_seq = 2*(time_halfbandwidth)-1;
[dps_seq, lambda] = dpss(seq_length,time_halfbandwidth,num_seq);
for i=1:seq_length
sum(dps_seq,2)=pcp(i);
end
  2 comentarios
Krishna Bindumadhavan
Krishna Bindumadhavan el 8 de Mayo de 2018
Hi Abena. If I understand the question correctly, you want to modify an inbuilt function.
You can actually view the MATLAB source for the dpss function by typing
>> edit dpss
You can then edit the function, and then save that as a new function, for example dpss_edit.m.
You may then use this new function, dpss_edit in subsequent function calls.
Abena Amponsah
Abena Amponsah el 8 de Mayo de 2018
Thanks Krishna

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by