Question: Write a function that takes as inputs the integer indices n and iin { 1 , dots, N } , and returns as its output

Write a function that takes as inputs the integer indices n and iin{1,dots,N}, and returns as its output the sparse elementary vector ei.
To do this, replace each ?? with appropriate code.
using SparseArrays: sparsevec
function ei(i::Integer, n ::Integer)
@assert )(n)(1
ei ,??)
return ei
end
Revert
X Code errored (18ms)
LoadError: syntax: invalid identifier name "?"
syntax: invalid identifier name "?"
Stacktrace:
[1] top-level scope at In[9]:5
[2] include_string(::Function, ::Module, ::String, ::String) at
./loading.jl:1091
 Write a function that takes as inputs the integer indices n

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!