- Index
- » Programming
- » Modelica Language
- » assignment of a single value to an...
assignment of a single value to an element of a matrix or vector
assignment of a single value to an element of a matrix or vector
Hello,
is there a way to assign a single value to an element of a matrix or vector?
Using OMShell
>> b:=vector([{ii for ii in 1:10}])
{1,2,3,4,5,6,7,8,9,10}
>> b[4]
4
>> b[4]:=6
Error occured building AST
Syntax Error
[<interactive>:1:0-1:0:writable] Error: Parser error: Unexpected token near: b (IDENT)
Any idea why that doesn't work?
al
Re: assignment of a single value to an element of a matrix or vector
alberich wrote:
Any idea why that doesn't work?
Yes, array subscripting and slicing for assignments were not implemented in the scripting environment. I have just committed a fix for that in r15725, so it should be available tomorrow in the nightly builds. If you find any further issues, please submit a ticket to our bug tracker.
- perost
- 114 Posts
- Index
- » Programming
- » Modelica Language
- » assignment of a single value to an...