looping for a program

I have a dataset
X=[12 25 36 47 58 69;34 56 78 90 12 34 ;00 12 89 36 87 56 ]
Y=[89 36 87 56 00 25;25 36 47 87 56 25 ;89 78 45 23 56 99 ]
now i want to add first column of X any Y and store it in separate variables for each column
i have 100 rows

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 11월 7일

0 개 추천

m = size(X,1);
A = reshape(bsxfun(@plus,X(:,1),permute(Y,[3 2 1])),size(X,1),[]);
out = mat2cell(A,size(X,1),ones(size(A,2),1));

댓글 수: 1

FIR
FIR 2011년 11월 7일
thanks andrei can u tell how to plot k means clustering for same data please
i need one k means clustering graph for one row
so i need 3 k mean clustering graphs

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

FIR
2011년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by