Saving to structured variable in loop

Hi This is part of my code:
for i=1:18
for j=i+1:19
x = data(i,:);
y = data(j,:);
wcoh.(i,j)=wcoher(x,y);
end
end
Function wcoher computes from two rows of data one matrix. But i have 19 rows of data. And i want to compute wcoher for each pair. So the result would be structured variable for example wcoh->inside it variables 1-2,1-3,1-4,....5-6,...18-19-> and inside matrix computed by wcoher function.
Thx for help!!

댓글 수: 2

Andrei Bobrov
Andrei Bobrov 2013년 3월 14일
What are return wcoher ? Scalar or array?
Jakub
Jakub 2013년 3월 14일
matrix

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

 채택된 답변

Alessandro
Alessandro 2013년 3월 14일
편집: Alessandro 2013년 3월 15일

0 개 추천

If I understand you right you wannt to have:
wcoh= cell(Ny,Nx);
for i=1:Ny
for j=i+1:Nx
x = data(i,:); y = data(j,:);
wcoh{i,j}=wcoher(x,y);
end
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel Computing에 대해 자세히 알아보기

질문:

2013년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by