Ask Your Question
0

structure similar to Matlab Cells

asked 2011-10-22 03:08:44 +0100

mariano.real gravatar image

Hi I'm quite new in SAGE, I'm trying to learn it to migrate from Matlab. The problem I'm having is with Matlab cell structures, I couldn't find any similar structure in SAGE. The Matlab cells allows me to gather data of different sizes and styles in a single structure (matrices of different sizes for example) which I find really useful since my measurement data tends to change in size, headers, etc. Any feedback will be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-10-22 04:15:20 +0100

Jason Grout gravatar image

A python list can handle heterogenous data.

sage: a=[random_matrix(ZZ,3), random_matrix(ZZ,2), 'test string']
sage: a
[
[ -1   0  -1]                        
[  2  -1  -2]  [ 1  2]               
[ -8  -2 -18], [-3  2], 'test string'
]
sage: a[0]
[ -1   0  -1]
[  2  -1  -2]
[ -8  -2 -18]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-10-22 03:08:44 +0100

Seen: 396 times

Last updated: Oct 22 '11