Rev | Line | |
---|
[37] | 1 | function X = subsasgn(X,I,Y) |
---|
| 2 | %SUBASGN (overloaded) |
---|
| 3 | |
---|
| 4 | % Author Johan Löfberg |
---|
| 5 | % $Id: subsasgn.m,v 1.1 2005/05/25 12:15:04 joloef Exp $ |
---|
| 6 | |
---|
| 7 | try |
---|
| 8 | if strcmp('()',I.type) |
---|
| 9 | X_is_spdvar = isa(X,'sdpvar'); |
---|
| 10 | Y_is_spdvar = isa(Y,'sdpvar'); |
---|
| 11 | if any(I.subs{1} <=0) |
---|
| 12 | error('Index into matrix is negative or zero.'); |
---|
| 13 | end |
---|
| 14 | i = I.subs{1}; |
---|
| 15 | j = I.subs{2}; |
---|
| 16 | X.blocks{i,j} = Y; |
---|
| 17 | |
---|
| 18 | else |
---|
| 19 | error('Reference type not supported'); |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | catch |
---|
| 23 | error(lasterr) |
---|
| 24 | end |
---|
| 25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.