Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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

Edited by: alberich - Apr-01-13 09:41:00

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.

There are 0 guests and 0 other users also viewing this topic
You are here: