generating a diagnoal matrix

1 Ansicht (letzte 30 Tage)
Hello Matlab
Hello Matlab am 3 Apr. 2015
Kommentiert: Star Strider am 3 Apr. 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 Kommentar
Star Strider
Star Strider am 3 Apr. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Particle & Nuclear Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by