generating a diagnoal matrix

1 vue (au cours des 30 derniers jours)
Hello Matlab
Hello Matlab le 3 Avr 2015
Commenté : Star Strider le 3 Avr 2015
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 commentaire
Star Strider
Star Strider le 3 Avr 2015
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Particle & Nuclear Physics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by