- Normalize single column:
How to normalize a single row wise in MACONT, or multiply equation to single column only
1 view (last 30 days)
Show older comments
I am making a code for MACONT and using 3 normalization technique, I am unable to normalization single column with their respective value (0-1) eventually ended up normalizing the the whole data from 0-1
Or is this possible to mulitpy a certain equation to one coloumn only without extracting it
0 Comments
Answers (1)
Arun
on 21 Jun 2024
Hi Mrityanjay Kumar,
I understand that you want to normalize a single column or mulitply a certain equation to one coloumn only without extracting it.
Below are sample scripts to perform required opereations:
% Specify the column to normalize
colIndex = 2;
% Extract the column
col = data(:, colIndex);
% Normalize the column to the range [0, 1]
normalized_col = (col - min(col)) / (max(col) - min(col));
% Replace the original column with the normalized column
data(:, colIndex) = normalized_col;
2. Mulitply a certain equation to one coloumn only without extracting it:
% Specify the column to modify
colIndex = 2;
% Apply the equation directly to the column
data(:, colIndex) = data(:, colIndex) * 2;
This examples should give an idea of how to proceed and achieve the required task.
For more information related to multi-dimensional array, please refer the following documentation link: https://www.mathworks.com/help/matlab/math/multidimensional-arrays.html
Hope this helps!
Regards
Arun
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!