generating a diagnoal matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I need to initiate a matrix, like this:
SQ = diag ( sequare root(sqrt(S(l,:))-segma), sequare root(sqrt(S(2,:))-segma)......sequare root(sqrt(S(9,:))-segma),0)
But not sure how to do this in Matlab, my code is here, and I stopped at SQ line, I put a loop from 1 to 10 for j, but not sure how to do the rest of this Matrix
function [B] = FD(A,l)
[n,d] = size(A);
B = zeros(10,d);
B(1:9,:) = A(1:9,:);
for i=10:1125,
B(10,:) = A(i,:);
[U,S,V] = svd(B);
segma = sqrt(S(10,:));
for j=1:10,
SQ= diag ......
end
end
댓글 수: 1
Star Strider
2015년 4월 3일
Please provide an example of the matrix you want to create and the data you want to use from which you want to create it. It is not at all clear from the code you have provided.
What does the ‘sequare root’ function produce? We have absolutely no idea.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!