Why getting this error??
3 views (last 30 days)
Show older comments
min=min(data);
max=max(data);
normdata=(data - min)./(max - min)
Why getting this error??
Error using -
Matrix dimensions must agree.
0 Comments
Answers (2)
James Tursa
on 16 Dec 2020
Edited: James Tursa
on 16 Dec 2020
Don't shadow the MATLAB min() and max() functions with variables of the same name. Also min() and max() operate on columns by default, not the entire matrix. Maybe this is what you want:
mindata = min(data(:));
maxdata = max(data(:));
normdata = (data - mindata)./(maxdata - mindata)
0 Comments
See Also
Categories
Find more on Dynamic System Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!