MATLAB Problem. How to design matrix from eigenvalues
7 ビュー (過去 30 日間)
古いコメントを表示
This is a previously posted problem that I am working on but I can't find any solutions online. Here is the description:
Write a function that takes one input argument n and outputs a (n x n) square matrix A with the following properties:
- A has an eigenvalue of 3
- all elements of A differ more than .5 from each other
Here is what I have tried so far. I am having difficulty with setting up the specific eigenvalue.
function A = matrix_design(n)
A=randn(n); % set up the matrix
[V,D]=eig(A) % use built-in function for eigendecomposition
abs(A-A.')>0.5 % specify elements of A to differ by 0.5
end
disp(A)
2 件のコメント
Walter Roberson
2023 年 1 月 23 日
Is it possible at all?
d = sym(2)/3
syms c
M = [c+0*d, c+1*d, c+2*d
c+3*d, c+4*d, c+5*d
c+7*d, c+9*d, c+8*d]
[V,D] = eig(M);
c0 = solve(D(1)==3, c)
Mnum = double(subs(M, c, c0))
eig(Mnum)
... I guess so, at least for the 3 x 3 case -- and assuming that "A has an eigenvalue of 3" means that at least one of the eigenvalues of the matrix is 3
採用された回答
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!