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 Praveenpk  
#1 Posted : 30 April 2020 11:32:46(UTC)
Praveenpk

Rank: Newbie

Groups: Registered
Joined: 30/04/2020(UTC)
Posts: 2
India
Location: Bangalore

Hi I am new to Smath

I want to select few variables. eg
If P=1, then X = 1, Y=2 & Z=3
If P=2, then X = 4, Y=1 & Z=7
If P=3, then X = 3, Y=2 & Z=1

I want to use X, Y & Z values based on the selected value of P

Thanks in advance

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

Offline Jean Giraud  
#2 Posted : 30 April 2020 14:33:57(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)
p[XYZ].PNG
Offline Praveenpk  
#3 Posted : 30 April 2020 14:36:30(UTC)
Praveenpk

Rank: Newbie

Groups: Registered
Joined: 30/04/2020(UTC)
Posts: 2
India
Location: Bangalore

Thanks Jean

I will try this one
Offline ndtma  
#4 Posted : 30 April 2020 14:42:33(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Using "cases" function.
Cases_Function.png

cases_ex.sm (90kb) downloaded 9 time(s).

Edited by user 30 April 2020 14:46:31(UTC)  | Reason: Not specified

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
thanks 1 user thanked ndtma for this useful post.
on 01/05/2020(UTC)
Offline Jean Giraud  
#5 Posted : 30 April 2020 15:26: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: Praveenpk Go to Quoted Post
I will try this one


Page1 if_oterwise.sm (5kb) downloaded 9 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 01/05/2020(UTC)
Offline hawe  
#6 Posted : 30 April 2020 17:25:14(UTC)
hawe


Rank: Advanced Member

Groups: Registered
Joined: 30/03/2020(UTC)
Posts: 31
Germany
Location: KU

Was thanked: 3 time(s) in 2 post(s)
If you want to use the variable names X,Y,Z

a simple

data:mat(1,4,3,2,1,2,3,7,1,3,3)
mat(X,Y,Z,3,1):col(data,p)

will do the job.

you can also use a vector XYZ
XYZ:el(data,range(1,3),p)
and its components i=1..3
el(XYZ,i)

--
copy code to sheet

Edited by user 30 April 2020 17:35:07(UTC)  | Reason: Not specified

thanks 1 user thanked hawe for this useful post.
on 01/05/2020(UTC)
Offline Jean Giraud  
#7 Posted : 30 April 2020 18:41:19(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)
Generalize demo. No sweat to capture [X,Y,Z] from n*m matrix.

Page5 Generalize.sm (6kb) downloaded 19 time(s).
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.