# Find the value of r such that the determinant of A is zero.

4 views (last 30 days)

Show older comments

Hello,

I am have matrix A with r as the parameter. I want to find the value of r such that the determinant of A is zero.

A=[cosd(90),0,-r*sind(90);0,1,0;sind(90),0,r*cosd(90)]

Answer should be r=0 , But I got it r=-5.5511e-17 that is incorrect.

Thanks in advance :)

fun = @(r)[cosd(90),0,-r*sind(90);0,1,0;sind(90),0,r*cosd(90)];

r_val = fzero(@(r)det(fun(r)),1)

##### 0 Comments

### Accepted Answer

Jan
on 24 Jul 2022

##### 5 Comments

Bruno Luong
on 25 Jul 2022

fun = @(r)[cosd(90),0,-r*sind(90);0,1,0;sind(90),0,r*cosd(90)];

r_val = fzero(@(r)det(fun(r)),1,struct('TolX',1e-30))

To me in this particular example, fzero stops because it estimates it close less tha 1e-16 to the solution.

Again in THIS specific case, there is no issue of precision issue when r get closer to 0

r=logspace(0,-30)

loglog(r,arrayfun(@(r) det(fun(r)), r))

### More Answers (1)

Walter Roberson
on 24 Jul 2022

syms r

A=[cosd(90),0,-r*sind(90);0,1,0;sind(90),0,r*cosd(90)]

solve(det(A))

This will get you the exact 0

### See Also

### Categories

### Products

### Community Treasure Hunt

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

Start Hunting!