MATLAB Answers

MATLAB normalize function shadowed by DSP toolbox normalize function

10 views (last 30 days)
Hi,
When I am trying to use in MATLAB R2019a,
normalize(X,'range');
The following error occurs,
Error using sum
Invalid option. Option must be 'all', 'double', 'native', 'default', 'omitnan', or 'includenan'.
Error in normalize (line 10)
It seems the matlab is using the normalize function in DSP toolbox. How can I use the MATLAB default normalize function?.
Thanking in advance for your help

Accepted Answer

Steven Lord
Steven Lord on 29 Oct 2019
Can you confirm that MATLAB is using the version from DSP System Toolbox and not the one from MATLAB or that you've created or downloaded? Run this command with the X on which you're trying to operate in the workspace:
which -all normalize(X, 'range')
I don't think the version of normalize in DSP System Toolbox even calls sum, and line 10 of the one included in MATLAB is a help text comment. I think you have a different normalize.m that's shadowing the one in MATLAB. Rename that normalize.m, remove it, or move it lower on the MATLAB path than the one in MATLAB.
  1 Comment
Kaveen Liyanage
Kaveen Liyanage on 29 Oct 2019
Hi, Thanks for the response,
Yes, following is the output.
C:\Users\******\******\PRML-PRMLT-v2.0.1-1-g314f475\PRML-PRMLT-314f475\common\normalize.m
C:\Program Files\MATLAB\R2019a\toolbox\matlab\datafun\normalize.m
I removed the first one from the path. Now works fine. Thanks

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!