How to normalize a single row wise in MACONT, or multiply equation to single column only

조회 수: 1 (최근 30일)
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

답변 (1개)

Arun
Arun 2024년 6월 21일
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:
  1. Normalize single column:
% 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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by