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

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline Britt1  
#1 Posted : 01 May 2019 23:40:54(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Can text be included in an if statement? For example:
If "Thin-walled pipe anchored throughout" then P=1-v.

I have various conditions that different formulas would be used depending on the conditions, see below.restraints.png

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

Offline Razonar  
#2 Posted : 02 May 2019 00:24:24(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. You have some options for do that. Here are two:
Clipboard01.gif
Best regards.
Alvaro.
Offline Jean Giraud  
#3 Posted : 02 May 2019 04:04:46(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: Razonar Go to Quoted Post
You have some options for doing that.

Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG

Offline Britt1  
#4 Posted : 02 May 2019 23:41:07(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

I don't understand how to input the data into the statement. If I press the space key, the input ends, and I cannot input anything.
Offline Jean Giraud  
#5 Posted : 02 May 2019 23:47:44(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: Britt1 Go to Quoted Post
I don't understand how to input the data into the statement.
If I press the space key, the input ends, and I cannot input anything.

There is no space key to press. Construct the snippet, done.
Offline Britt1  
#6 Posted : 03 May 2019 00:04:03(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Sorry, I have never constructed a snippet before. How do I do that?
Offline Jean Giraud  
#7 Posted : 03 May 2019 01:05:13(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: Britt1 Go to Quoted Post
Sorry, I have never constructed a snippet before. How do I do that?

Construct the math regions as per the image that we call snippet.
Offline Britt1  
#8 Posted : 03 May 2019 16:15:42(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

I tried to construct it. My question is how to do that. I try and the below is what happens:if statement.png
Offline Jean Giraud  
#9 Posted : 03 May 2019 19:09:07(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)
g(str,x):=then from menu f(x), then cases, then fill-in
Offline fedeghi  
#10 Posted : 03 May 2019 20:11:45(UTC)
fedeghi


Rank: Advanced Member

Groups: Registered
Joined: 14/09/2013(UTC)
Posts: 90
Italy

Was thanked: 24 time(s) in 16 post(s)
The cases() function is included into the "custom functions" plugin, so you should also be sure to have it installed.

Cattura.PNG
thanks 1 user thanked fedeghi for this useful post.
on 03/05/2019(UTC)
Offline Britt1  
#11 Posted : 03 May 2019 22:16:46(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: fedeghi Go to Quoted Post
The cases() function is included into the "custom functions" plugin, so you should also be sure to have it installed.

Cattura.PNG


Thank you. I had the "custom functions" plugin installed, but the use of it is not in any of the manuals, at least not that I could find. I had no idea I had to type the word "cases" to get to the input.
Offline Britt1  
#12 Posted : 03 May 2019 22:19:43(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Jean Giraud Go to Quoted Post
g(str,x):=then from menu f(x), then cases, then fill-in


Thank you. I understand now.
Offline Jean Giraud  
#13 Posted : 03 May 2019 23:37:20(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: Britt1 Go to Quoted Post
I had no idea I had to type the word "cases"

only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.
Offline Britt1  
#14 Posted : 03 May 2019 23:48:24(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Britt1 Go to Quoted Post
I had no idea I had to type the word "cases"

only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.


Thank you. I was trying to figure out how to do that.
Offline Britt1  
#15 Posted : 07 May 2019 19:15:44(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
You have some options for doing that.

Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.
Offline Britt1  
#16 Posted : 07 May 2019 19:39:45(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Britt1 Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
You have some options for doing that.

Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.


I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.
Offline Jean Giraud  
#17 Posted : 07 May 2019 20:54:10(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: Britt1 Go to Quoted Post
I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.


Equality.PNG

Offline Davide Carpi  
#18 Posted : 07 May 2019 21:18:13(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Britt1 Go to Quoted Post
Originally Posted by: Britt1 Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
You have some options for doing that.

Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.


I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.


Please post the worksheet or a screenshot. In the second column of cases you have to use boolean equals, not the assignment operator.

You can find the boolean operators in one of the palettes on the right of your screen, hovering the mouse hover the symbols you should see the keyboard shortcut.
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Britt1  
#19 Posted : 07 May 2019 21:26:07(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Britt1 Go to Quoted Post
I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.


Equality.PNG



thank you. I can't use the "Thank" button because every time I do, it says "error occurred"
Offline Britt1  
#20 Posted : 07 May 2019 21:31:51(UTC)
Britt1


Rank: Advanced Member

Groups: Registered
Joined: 20/03/2019(UTC)
Posts: 73
United States
Location: Mandeville, LA

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Britt1 Go to Quoted Post
I had no idea I had to type the word "cases"

only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.


How do I remove a line. I tried backspacing, and it did not work.
Users browsing this topic
Guest
2 Pages12>
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.