sparse compatibility check

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sparse compatibility check

Rik-4
Could someone run the following under Matlab and paste back the result?

---Code---
x = sparse ([1 0; 0 2])
cos (x)
---End Code---

Thanks,
Rik

Reply | Threaded
Open this post in threaded view
|

Re: sparse compatibility check

rdzman
On Oct 7, 2015, at 12:49 PM, Rik <[hidden email]> wrote:

Could someone run the following under Matlab and paste back the result?

---Code---
x = sparse ([1 0; 0 2])
cos (x)
---End Code---

Thanks,
Rik


>> x = sparse ([1 0; 0 2])

x =

   (1,1)        1
   (2,2)        2

>> cos (x)

ans =

   (1,1)       0.5403
   (2,1)       1.0000
   (1,2)       1.0000
   (2,2)      -0.4161