Sagecell v1 and matlab as default interpreter

33 views
Skip to first unread message

fero

unread,
Aug 8, 2012, 12:33:02 AM8/8/12
to sage-...@googlegroups.com
Dear all,

I open a new post in order to be more specific.

Is there any way to open a Sagecell that use matlab as default interpreter
(or have a "select" box, like I can do in the notebook) ?

Anyone can help me in reaching this result please?
I'd like to abandon the notebook interface, because I found it too much hacky to integrate in another app.

Keep in mind that I'd like to use Sagecell version 1 because I couldn't manage to make sagecell v2 working right now.

Thanks
Luca

Jason Grout

unread,
Aug 8, 2012, 12:57:13 AM8/8/12
to sage-...@googlegroups.com
On 8/7/12 9:33 PM, fero wrote:
> Dear all,
>
> I open a new post in order to be more specific.
>
> Is there any way to open a Sagecell that use matlab as default interpreter
> (or have a "select" box, like I can do in the notebook) ?

It isn't built in to the sage cell right now. I wonder if you
automatically wrap any input in

matlab.eval("""

and

""")

before it is executed, if that might do the trick for your use-case.
Even better would be to use matlab.eval to execute code in the backend
device.

Sorry I can't be of more help; I don't have much time to work on the
sagecell right now.

Thanks,

Jason


Andrea Lazzarotto

unread,
Aug 8, 2012, 3:54:31 AM8/8/12
to sage-...@googlegroups.com

Did you try to put "%matlab" as the first line of your cell?

Andrea Lazzarotto
(inviato da Android)

fero

unread,
Aug 8, 2012, 7:25:58 AM8/8/12
to sage-...@googlegroups.com


Il giorno mercoledì 8 agosto 2012 09:54:31 UTC+2, Andrea Lazzarotto ha scritto:

Did you try to put "%matlab" as the first line of your cell?


Thanks Andrea and Jason,

Jason: to wrap it all in matlab.eval was the basic idea... I'll try it,
can you point me in the right place to do it pls? I can modify the backend, no problem in make a hack for this time.

Andrea: pleased to read you in this group :). Do you mean like:

%matlab

a = [ 1 ,2  ; 10, 15]
a'

It seems not to work. Tested in http://aleph.sagemath.org/ I have got

  File "<ipython-input-1-4ebd74501542>", line 3
    a = [ Integer(1) ,Integer(2)  ; Integer(10), Integer(10)]
                                  ^
SyntaxError: invalid syntax
  File "<ipython-input-1-4ebd74501542>", line 3
    a = [ Integer(1) ,Integer(2)  ; Integer(10), Integer(10)]
                                  ^
SyntaxError: invalid syntax



Andrea Lazzarotto

unread,
Aug 8, 2012, 7:59:52 AM8/8/12
to sage-...@googlegroups.com


2012/8/8 fero <lu...@befair.it>

Andrea: pleased to read you in this group :). Do you mean like:

%matlab

a = [ 1 ,2  ; 10, 15]
a'

It seems not to work.

Yes that was my suggestion, but yes it seems to work only on the sage notebook...

--
Andrea Lazzarotto - http://andrealazzarotto.com

Reply all
Reply to author
Forward
0 new messages