Hi again! On 29 Okt., 15:29, Ross <r76...@gmail.com> wrote: > hi everyone > > I want to translate some matlab code into sage > but i get some problem > here are the matlab code > > if omega<=-yo > uno=1; > elseif omega>=-yo & omega<=0 > uno=omega/-yo; > else uno=0; > end [...] > Q: > 1.If i have this kind of question what can i read first? > 2.What Syntax Error is on my code? > 3.Where can i find the basic usage of the code i want to use in > the upon matlab code?
I think in the preceding post I only answered 1. and 2. Concerning 3.: The little bit of matlab code that you state above is certainly covered in "Dive into Python" or another tutorial, because here one just has a bit "if-elif-else", logic, basic arithmetics and assignments. So, the translation would be if omega<=-yo: uno=1 elif omega>=-yo and omega<=0: uno=omega/-yo else: uno=0 (but please preserve the indentation) I hope you are not disappointed by the fact that I talk here about Python and not about Sage. Sage comes in as soon as omega and yo are fancy things that Python doesn't know (but the syntax wouldn't change, of course). Cheers Simon --~--~---------~--~----~------------~-------~--~----~ 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 URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---