Question: Write a function that returns the error between qhat and q as defined above. Hint: Your function should return values on the order of 1

Write a function that returns the error between qhat and q as defined above.
Hint: Your function should return values on the order of 1e-15 for qhat and 9 generated as below.
q=randn(10)
q=qnorm(q)
=rand()**2**
qhat =exp(im**)**q
@show evecerror (qhat,q);
using LinearAlgebra: norm
function evec_error(qhat::AbstractVector, q::AbstractVector)
@assert isapprox(norm(qhat),1.0) "qhat is not of unit norm"
@assert isapprox(norm(q),1.0)"q is not of unit norm"
alpha = qhat ?'**q
error qhat -??**q
return error
end
Run
Verify Solution
X Code errored (5s)
LoadError: syntax: invalid identifier name "?"
 Write a function that returns the error between qhat and q

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!