Type 1 Cosine Transform

I want to use Type 1 Cosine Transform instead of the default Type 2. However, when I tried what suggested from Matworks: dct(x,'Type',1), it gave me the error
"Error using dct, Too many input arguments." May I ask what I am supposed to do? Thank you and I appreciate your help!

4 Comments

Hi LL,
I tried dct(1:10,'Type',1) and it works. You may want to try
which dct -all
and see what it says, in case there is a different dct floating around besides the standard one.
I believed that I tried with the right dct. May I ask which version of Matlab you have, I have R2016a. Below are the message.
>> which dct -all
/Applications/MATLAB_R2016a.app/toolbox/images/images/private/dct.m % Private to images
/Applications/MATLAB_R2016a.app/toolbox/signal/signal/dct.m
>> dct(1:10,'Type',1)
Error using dct
Too many input arguments.
Thank you and I appreciate it!
David Goodmanson
David Goodmanson on 8 Feb 2019
Edited: David Goodmanson on 8 Feb 2019
I am using 2018b. Your Matlab path certainly looks to be appropriate. I wanted to try this with my archived 2016b but at that time I didn't have the signal processing toolbox, so I cannot. Maybe someone else will weigh in.
Thank you David! I downloaded 2018b version and it worked perfectly! Thank you :=)

Sign in to comment.

Answers (1)

Stephan
Stephan on 8 Feb 2019

0 votes

Hi,
the option 'Type' was introduced in R2017a - see the release notes for Signal Processing Toolbox. To avoid this kind of issues, make sure to work with the documentation that matches the Matlab Relase you are using. The documentation you find first on mathworks.com is always the one for the current release. For the next few weeks this will be R2018b until the release R2019a will be published.
Best regards
Stephan

Products

Asked:

on 8 Feb 2019

Answered:

on 8 Feb 2019

Community Treasure Hunt

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

Start Hunting!