matrix convertion needs modification
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to create a matrix with entries -1, 0, and 1 but it gives only -1 and 1, how to adjust
x = [9 3.6 9; 11 3.6 9; 9 4.4 9; 11 4.4 9; 9 3.6 11; 11 3.6 11;9 4.4 11; 11 4.4 11];
% convertion to -1, 0, and 1
V = ( x(:,1) - min(x(:,1)) )/(range(x(:,1))/2) - 1; %% This line needs some modifications
% NOW convert to MATRIX (-1. 0, and 1)
% Below lines also need some modifications
X = [(x(:,1) - min(x(:,1)))/1 - 1 (x(:,2) - min(x(:,2)))/0.4 - 1 (x(:,3) - min(x(:,3)))/1 - 1]
댓글 수: 3
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!