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 inazuma  
#1 Posted : 19 April 2019 16:09:59(UTC)
inazuma

Rank: Newbie

Groups: Registered
Joined: 19/04/2019(UTC)
Posts: 1
France

Hello,

I'm a newbie in SMath, so maybe it's just a bad usage.

Why the following for loop:

I:=[5..10]
for i € I
xi := i

generate this result:
x=[0 0 0 0 5 6 7 8 9 10]

Thank you for your answer !

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

Offline MarB  
#2 Posted : 19 April 2019 16:51:58(UTC)
MarB


Rank: Advanced Member

Groups: Registered
Joined: 21/10/2016(UTC)
Posts: 84

Was thanked: 21 time(s) in 17 post(s)
You are assigning the values 5 to 10 to the 5th, 6th ...up to 10th element of the vector x.
The first 4 elements are filled with zeros.
thanks 1 user thanked MarB for this useful post.
on 20/04/2019(UTC)
Offline Jean Giraud  
#3 Posted : 20 April 2019 02:51:22(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: inazuma Go to Quoted Post
Why the following for loop:

Pad.PNG
thanks 1 user thanked Jean Giraud for this useful post.
on 20/04/2019(UTC)
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.