How to get solution to make this determinant zero? [closed] - matlab

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
A = [A-x(1) B-x(2) C-x(3);D-x(4) E-x(5) F-x(6); G-x(7) H-x(8) I-x(9)]
I have to obtain x(1)...x(9) for det(A) = 0.

Given a 3x3 matrix A
its determinant is
therefore you need to solve |A| = 0. For your case we are given
The easiest solution for x so that |A| = 0 is when
a - x(1) = 0
b - x(2) = 0
c - x(3) = 0
which leads to
x(1) = a
x(2) = b
x(3) = c
so
x = A
is the most trivial solution. There exists an infinite number of solutions to this problem, this is just one. You could choose another solution where
a - x(1) != 0
b - x(2) != 0
c - x(3) != 0
and then you would have to set
ei - fh = 0
di - fg = 0
dh - eg = 0
which would involve simultaneous equations.
I suggest before trying to code up a solution you work through one by hand like I've done here.

Related

Hash functions violating some pre image properties [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
Suppose H(xy) = H(x) * H(y) . Clearly preimage properties are violated. How can we find x, y such that H(x) = H(y) mod (2^k)
2^k is a very special modulus. You can prove the following strengthened version of Euler's theorem:
Suppose that x is any postive integer. Then x^phi(2^k) (mod 2^k) is equal to either 0 or 1, with 1 if and only if x is odd.
Proof:
If x is odd, then gcd(x,2^k) = 1, hence x^phi(2^k) (mod 2^k) = 1 by Euler's theorem.
Suppose that x is even. The result is trivially true if x = 0, so suppose that x > 0. Write x = (2^s)*y where y is odd and s > 0. Note that
phi(2^k)` = 2^(k-1)
But then,
x^phi(2^k) = (2^s*y)^phi(2^k)
= (2^s)^phi(2^k) * y^phi(2^k)
= 2^(s*phi(2^k)) * y^phi(2^k)
= 2^(s*2^(k-1)) * y^phi(2^k)
= 0 * y^phi(2^k) = 0 (mod 2^k)
the last line follows from the fact that s*2^(k-1) >= k hence 2^(s*2^(k-1)) is a multiple of 2^k.
Note that if x is even then you actually have x^k = 0 (mod 2^k), so raising x to the power phi(2^k) is overkill for any but the smallest k.
Given this lemma, it is now trivial to see that there exists distinct x,y with either H(x) = H(y) = 0 or H(x) = H(y) = 1. Since it seems to be homework, I'll leave the details to you.

Filter coefficients in matlab [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm learning about signal processing and currently I have to do an speech synthesizer in Matlab. For emulate the resonator system of the mouth I've this transfer function:
R(z) = 1 - z ^(-1)
Can I implement this system with filter function in Matlab? I don't know how to extract the coeficients "a" and "b"...
Note: y = filter(b, a, x), where x is the input signal that we have to filter.
Thank you all!
Consulting the documentation for filter, you represent a transfer function as a rational function of coefficients such that:
The desired transfer function you want, Y(z) / X(z) = R(z) is equal to:
R(z) = 1 - z^{-1}
Here a(1) is implicitly equal to 1. Therefore, b(1) = 1 and b(2) = -1 referring to the above equation. All of the coefficients in the denominator are 0 except for a(1) which is equal to 1.
As such, a = 1; b = [1 -1]; and so filtering your signal is simply:
a = 1; b = [1 -1];
y = filter(b, a, x);
x is the signal of interest you want to filter.

finding all factors of a number [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am new to Matlab and for the values of a, l and w i need to find all the values for l in the data set and the corresponding w values.
a=10;
l=(0:10)
w=(0:10)
for l,d
if a == l.*w
disp(l)
disp(w)
end
end
Not sure what you want to do, but I think your code could be put as follows:
a = 10;
l = 0:a; %// actually, it would suffice to check numbers up to floor(a/2)
ind = rem(a,l)==0; %// logical index that tells if remainder is zero or not
disp([l(ind); a./l(ind)])
Result:
1 2 5 10
10 5 2 1
You could do it more directly with Matlab's factor function:
f = factor(a);
disp([f; a./f])
Result:
2 5
5 2

Interpolating arrays with different vectors [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I have multiple arrays that I need to identify and interpolate to a set number. the set number will be the 'length?' of the biggest array. I need to How could I identify each array length and create a loop to interpolate each array to that specific length? Sorry if I am not providing enough detail.
A = rand(10,2);
B = rand(20,2);
C = rand(5,2);
%find max length, for you cell array you want: max(cellfun(#(x) length(x), MyCellArray))
n = max([length(A), length(B), length(C));
%repeat for each, i.e. loop through the cell array
x = A(:,1);
y = A(:,2);
m = min(x);
M = max(x);
d = (M - m) / n;
xi = m:d:M;
Ai = interp1(x, y, xi);

why mandelbrot's boundary is 2? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to understand why we're iterating through Mandelbrot points until |z| < 4.
why 4? is there somekind of a law? or is it based on statistical measurements?
thanks, igal
Consider the Mandelbrot set with along y=0, which would would be z(i) = z(i-1)^2 + c.
Consider when c = (x=-2, y=0)
z(0) = 0
z(1) = 0^2 + -2 = -2
z(2) = (-2)^2 + -2 = 4 - 2 = 2
z(3) = 2^2 + -2 = 4 - 2 = 2
z(...) = 2^2 + -2 = 4 - 2 = 2
This example (x=-2,y=0) is the point with the greatest magnitude that will never blow up. Thus when z^2 > 4, there is no point in further iteration since you already know it will blow up.
All other points where the magnitude of the point >= 2 will blow up.