i have S 300x800 data set matrix , i need code for replacing coloumns
이전 댓글 표시
i have S 300x800 data set matrix , i need code for replacing column 120 with 50,and 120 with 121,and 240 with 100 and 240 with 241 ,and 360 with 150 and 360 with 361,.. what is the easy way of doing it with large data set 50 matrix of 300x800 each ?
댓글 수: 2
Walter Roberson
2017년 12월 31일
I notice that you have listed two replacement columns for each column. Are you looking to replace one column each time?
ihab
2017년 12월 31일
채택된 답변
추가 답변 (1개)
Walter Roberson
2017년 12월 31일
to_replace = 120:120:800;
for K = 1 : length(to_replace)
temp = OriginalMatrix;
temp(:,to_replace(K)) = temp(:,K*50);
NewMatrix{2*K-1} = temp;
temp = OriginalMatrix;
temp(:,to_replace(K)) = temp(:,to_replace(K)+1);
NewMatrix{2*K} = temp;
end
카테고리
도움말 센터 및 File Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!