function output problem
- From: "Y Ding" <yxd268@xxxxxxxxxx>
- Date: 6 Aug 2005 08:36:21 -0700
Hi everyone,
I have defined a function with two output arguments. however, when I
run the function, it always only gives the first argument as the final
answer. I don't know what happen. Hope you can help me with this.
function [vector,eigens] = Sr(n,x)
% CSD - Schur decomposition of the Cross spectrum
% x - Angular frequency
% n - spatial points
for i = 1:n
for j = 1:n
CSM(i,j) = S(x)*Coh(x)^abs(i-j);
end
end
[vector,eigens]=schur(CSM);
it gives the answer:
ans =
-0.4990 -0.7071 0.5010
0.7085 -0.0000 0.7057
-0.4990 0.7071 0.5010
which is only the eigenvectors
If I do not hide the result of the final line, it gives:
vector =
-0.4990 -0.7071 0.5010
0.7085 -0.0000 0.7057
-0.4990 0.7071 0.5010
eigens =
0.1883 0 0
0 0.1913 0
0 0 0.1943
ans =
-0.4990 -0.7071 0.5010
0.7085 -0.0000 0.7057
-0.4990 0.7071 0.5010
.
- Follow-Ups:
- Re: function output problem
- From: Steven Lord
- Re: function output problem
- From: Nasser Abbasi
- Re: function output problem
- Prev by Date: Re: XPC serial comm problem
- Next by Date: Re: matlab - strange behaviour
- Previous by thread: algo for ray tracing.......
- Next by thread: Re: function output problem
- Index(es):
Relevant Pages
|