Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Hello, how can I do a (loop) for this equation to find more than one value of the CF ? Specifically, I mean more than one value for (xm)
조회 수: 1 (최근 30일)
이전 댓글 표시
function [CF]= Coherence_Factor(xm,N);
CF = ((abs (sum(xm))).^2) / (N* sum(abs(xm.^2)))
end
댓글 수: 0
답변 (1개)
VBBV
2022년 12월 31일
편집: VBBV
2022년 12월 31일
xm = rand(5,10);
N = 10;
[CF]= Coherence_Factor(xm,N)
function [CF]= Coherence_Factor(xm,N);
CF = ((abs (sum(xm))).^2) ./ (N* sum(abs(xm.^2)));
end
댓글 수: 2
VBBV
2022년 12월 31일
for loop is not needed to find more than one value of CF or xm. However, you can still get such result with for loop also as
xm = randi([0 10],1,10);
N = 10;
for k = 1:length(xm)
CF(k)= Coherence_Factor(xm(k),N);
end
plot(CF)
function [CF]= Coherence_Factor(xm,N);
CF = ((abs (sum(xm))).^2) / (N* sum(abs(xm.^2)));
end
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!