Identity Matrix

Question: Define a function 'im' that returns an n x n identity matrix

More Information:

https://en.wikipedia.org/wiki/Identity_matrix

Example

                                
                                q)im[3]
100b
010b
001b
                                
                            

Solution

Tags:
functions iterators math
Searchable Tags
algorithms api csv dictionaries feedhandler finance functions ingestion ipc iterators math optimizations realtime sql streaming strings tables temporal websockets

Email sent!

Email not sent