generating a diagnoal matrix

1 次查看(过去 30 天)
Hello Matlab
Hello Matlab 2015-4-3
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
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 CenterFile Exchange 中查找有关 Particle & Nuclear Physics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by