how do i get values of ratios instead of the 0 matlab gives me?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Raymond Kazibwe
am 16 Dez. 2016
Kommentiert: Star Strider
am 19 Dez. 2016
how do i get values of ratios instead of the 0 matlab gives me?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Dez. 2016
We need to know what you are doing.
See if format long (or other format options) changes the result.
2 Kommentare
Star Strider
am 19 Dez. 2016
With this code:
format short g
A=[1 -1 -1 1 ;2 0 2 0;0 -1 -2 0;3 -3 -2 4];
b=[0;8;-8;7];
n=length(b)
x=zeros(n,1)
x(n) = b(n)/A(n,n)
I get:
x =
0
0
0
1.75
as the final result.
If you want to do the division on your entire vector and matrix, this assignment:
x_mtx = bsxfun(@rdivide, b, A)
gives you this result:
x_mtx =
0 0 0 0
4 Inf 4 Inf
-Inf 8 4 -Inf
2.3333 -2.3333 -3.5 1.75
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matched Filter and Ambiguity Function 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!