Undefined function 'triang' for input arguments of type 'double'.

1 view (last 30 days)
Hi there,
The suggested solutions do not work for me. Could you please let me know about the other potential solution?
Thanks!
  2 Comments
Stephen23
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.
Oliver Gloede
Oliver Gloede on 20 Jan 2016
Hi,
I was referring to the suggested checks in the previous threat:
"Do you have the Signal Processing Toolbox?"
-> Yes, I do.
"If you do have the toolbox then we need to check that your path is set correctly."
-> Yes, the path is correctly set.
"If all of the above checks out and it still doesn't work then I have another ace up my sleeve but it's a little more complicated. Let me know how you get on."
-> I would be grateful to receive further support how to solve the issue.
Thanks.

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 19 Jan 2016
Looking at the algorithm for triang, an equivalent function is relatively easy to code.
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
Star Strider
Star Strider on 25 Jan 2016
My pleasure.
If my Answer solved your problem, please Accept it.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!