set some values to zero in a matrix or vector
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone,
I am doing the svd in Simulink, I got the eigenvalue, now I want to set some eigenvalues smaller than a given value to zero. for example, if the eigenvalue small than 2, i set it to zero and keep the those eigen values large than 2 unchanged, incuding the place in the matix and the value.
PS: my matlab is 2009b, there are no Find block. so I can not use that block to find the zero value also.
Thank you very much!
0 Kommentare
Antworten (1)
Fangjun Jiang
am 30 Mai 2011
How do you do it in Simulink? It sounds like a Matlab data processing problem, e.g.
a=4*rand(3,3)
a(a<2)=0
If you do it in Simulink, what I can think of is that you demux your matrix to individual value, and then use a switch block to compare these individual value, if it is less than 2 then output zero, otherwise, pass it through. At the end, mux them together.
3 Kommentare
Fangjun Jiang
am 31 Mai 2011
@Oleg, I think she is asking if there is an easier way to do it in Simulink. The approach I suggested above in Simulink is a brutal force approach.
@Hongmei Hu, Is there a particular reason that you have to do it in Simulink? To me, SVD is best dealt with using Matlab.
Siehe auch
Kategorien
Mehr zu Linear Algebra 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!