Undefined function 'triang' for input arguments of type 'double'.
1 view (last 30 days)
Show older comments
Hi there,
I get the same problem as the user here: https://www.mathworks.com/matlabcentral/newsreader/view_thread/295970
The suggested solutions do not work for me. Could you please let me know about the other potential solution?
Thanks!
2 Comments
Stephen23
on 19 Jan 2016
Edited: Stephen23
on 19 Jan 2016
What "solutions" are you referring to? That thread contains no "solutions" for a missing function, they are instructions telling you how to check if you have the Signal Processing Toolbox installed.
The advice was to run the command ver, which will print a list of the installed toolboxes. Have you done this? Please tell us exactly what the ver command prints.
Probably you do not have the Signal Processing Toolbox.
Answers (1)
Star Strider
on 19 Jan 2016
These will work for even and odd values of window length ‘L’:
Leven = @(L) [(rem(L,2) == 0).*[(2*((1:(L/2))-1))/L, 2-((2*(((L/2+1):(L+1))-1))/L)]];
Lodd = @(L) [(rem(L,2) == 1).*[(2*(1:(L+1)/2)/(L+1)), (2-(2*(((L+1)/2+1):L)/(L+1)))]];
They emulate the published algorithm for triang as stated in Definitions. They also contain their own logic to be sure they only return a triangular window for the correct value of ‘L’. These are the essence of the function, so it would be straightforward to wrap them in your own version of triang and use it as an equivalent function file.
3 Comments
See Also
Categories
Find more on Pulsed Waveforms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!