Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline experimentator  
#1 Posted : 26 May 2013 14:08:29(UTC)
experimentator


Rank: Member

Groups: Registered
Joined: 26/05/2013(UTC)
Posts: 21
Spain

Was thanked: 1 time(s) in 1 post(s)
First of all, I think Andrey the work you do is astonishing and thanks to all the community, too.

I have a problem, waht is wrong?

experimentator attached the following image(s):
Portapapeles07.jpg
Learning by doing

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mikekaganski  
#2 Posted : 26 May 2013 15:25:00(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
1. You should not use i's and j's as indices, because they also designate imaginary part of complex numbers. In some versions some of them, or both, cause errors when used otherwise.
2. You could use I and j as indices of k, not of C[k] or A[k].

It would be better if you attach the file.


Edit: Oh, it looks like you cannot assign anything to nested matrices...
Seems like you only can assign the whole new matrix to C[k].

Edited by user 26 May 2013 15:36:48(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline omorr  
#3 Posted : 26 May 2013 15:30:38(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

Try this


for(k,range(1,rows(A)),line(for(i,range(1,rows(Cool),for(j,range(1,cols(Cool),el(c,i,j):el(B,i,j)/el(el(A,k),i,j))),el(C,k):c,2,1))


C=mat(mat(4,2.5,2,1.75,1.6,1.5,3,2),mat(0.571,0.625,0.667,7,4,3,3,2),2,1)

It seems that direct assignment of a matrix element in a nested matrix is not allowed. Try to avoid such constructions - it will give trouble.

Regards,

Edited by user 03 September 2014 16:35:20(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#4 Posted : 26 May 2013 15:30:52(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,990
Germany

Was thanked: 1128 time(s) in 724 post(s)
The problem is in using nested indices on the left hand side. That does not work just as linear indexing of pre-allocated matrices does not work (would save a loop in the example).

File Attachment(s):
Matrizenindizierung.sm (7kb) downloaded 36 time(s).
mkraska attached the following image(s):
matrixindex.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline experimentator  
#5 Posted : 26 May 2013 20:58:08(UTC)
experimentator


Rank: Member

Groups: Registered
Joined: 26/05/2013(UTC)
Posts: 21
Spain

Was thanked: 1 time(s) in 1 post(s)
I thank you all!
Learning by doing
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.