create a variable to store sets

1 Ansicht (letzte 30 Tage)
jana
jana am 7 Jun. 2013
I would like to create a variable that stores a set of numbers for an arc (a,b).
S(a,b) = {1,2,3,4,5}
S(b,c) = {3,4,5} etc
but I dont know how to write it in matlab. Please help

Akzeptierte Antwort

Iain
Iain am 7 Jun. 2013
Sounds like you need a cell array:
S{set_no} = [2 3 5 6];
S(2} = [1 5 6 3 64 23];

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 7 Jun. 2013
S{1,1}='a',
S{1,2}='b'
S{1,3}={1,2,3,4,5}
S{2,1}='b',
S{2,2}='c'
S{2,3}={3,4,5}

Kategorien

Mehr zu Variables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by