Tim Lahey wrote:
> 
> On Dec 18, 2008, at 4:45 AM, Fernando wrote:
> 
>> Hello,
>>
>> I am a MATLAB user which it is considering to move to SAGE. Mainly, I
>> use MATLAB for algorithm prototyping, simulations and data processing.
>>
>> For those tasks, I usually implement the code using the vectorized
>> functionalities of MATLAB. This is the most efficient way to code in
>> MATLAB. For example, if I want to implement the equation:
>>
>> z = y*sin(x)
>>
>> for a specific values of x and y. I should code:
>>
>> y = [3 6 7];
>> x = [1 2 3];
>> z = y.*sin(x);
>>
>> Could someone tell me which is the best way to code this kind of
>> operations in SAGE?


I second what Tim said.  Here is an example session using numpy in Sage:

sage: import numpy
sage: y=numpy.array([3,6,7]).astype(int)
sage: x=numpy.array([1,2,3]).astype(int)
sage: z=y*numpy.sin(x)
sage: z
array([ 2.52441295,  5.45578456,  0.98784006])


Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to