Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试这个但似乎不起作用:
A = {{1,2},{3,4}} A[[1]][[2]] = 5;
我怎么能那样做?
目前我正在做
list = {3,5}; A[[2]] = list;
你的代码是正确的,除了一个小错误:)
你写了:
A = {{1, 2}, {3, 4}} A[[1]][[2]] = 5; ^ ^ | This space means multiplication!
正确的代码是
A = {{1, 2}, {3, 4}} ; A[[1]][[2]] = 5;
通常写成:
a = {{1, 2}, {3, 4}} ; a[[1, 2]] = 5;
请记住以小写字母开头标识符,因为大写字母是为系统名称保留的