Pick a number from a list if condition is meet - Messages

Let's say my n= 13 i want to get the value 30km/h for V, but if its 8 i want 60km/h.
I have tried with for/while/if. But im guessing im doing something wrong or i don't know what to write exactly.

Any help is much apprecite it!
Wrote
Worksheet6.sm (4 KiB) downloaded 25 time(s).
Thank you for the answer, but this doesn't help me. Or i don't understand it

Example, i have N=10, based on N i want to get V. V for N=10 it's from here:

Thing is i have 8 variable based on N, and i want to obtain the values only by changing N.
Sorry if i don't explain very well.
WroteThe procedure is to get a vector of the potential values which can then be accessed by index.
You also could implement it as a function v(n) = 30 + mod(n-1, 4)*10
Great it works now. I just have to figure it out how to implement it for the rest of the file

Thank you very much!
How would you tackle this one?

Wrote
Great it works now. I just have to figure it out how to implement it for the rest of the file.
Thank you very much!
How would you tackle this one?
Divide n by 2, a bit of rounding and offset adjustment should do the job.
WroteWrote
Great it works now. I just have to figure it out how to implement it for the rest of the file.
Thank you very much!
How would you tackle this one?
Divide n by 2, a bit of rounding and offset adjustment should do the job.
I can't seem to get it to work, and for next examples i need to match it with a list that has some randomnes in number list. Isn't there a way i can create a list of number and if my "n" matches that list then i can get the correct value? I tried with for, if and so on. but im still a newbie in Smath.
Thank you once again!
WroteWroteWrote
Great it works now. I just have to figure it out how to implement it for the rest of the file.
Thank you very much!
How would you tackle this one?
Divide n by 2, a bit of rounding and offset adjustment should do the job.
I can't seem to get it to work, and for next examples i need to match it with a list that has some randomnes in number list. Isn't there a way i can create a list of number and if my "n" matches that list then i can get the correct value? I tried with for, if and so on. but im still a newbie in Smath.
Thank you once again!
If there is no rule, then you have to provide a vector with values and adress it with index n. A simple lookup table by index. Fill the vector by hand, by reading a file or asking a chatbot.
WroteIf you have a limited set of choiches, this might be a solution.
Also, I think Martin has a point, since these "n" values should come from some formula.
This works but i have other areas with diferent increment and i can't control them with interval. I will list a few of them:

here is 1,2,3 then goes to 16,17,18 then 26,27,28.
So i have this interval from the picture above and the one before with "Latimea benzii".
WroteWroteIf you have a limited set of choiches, this might be a solution.
Also, I think Martin has a point, since these "n" values should come from some formula.
This works but i have other areas with diferent increment and i can't control them with interval. I will list a few of them:
here is 1,2,3 then goes to 16,17,18 then 26,27,28.
So i have this interval from the picture above and the one before with "Latimea benzii".
Found a not very fancy solution, but it works

pick a number from a list.sm (6 KiB) downloaded 23 time(s).
-
New Posts
-
No New Posts