Message Boards Message Boards

Use of Input - Strings and Value of Iterator

Hello-

I am trying to create a simple user-friendly program having to do with floods and aquatic invertebrates, and at the beginning I want to use the 'Input' function to define the number of floods, their timing, and sizes. I have already used 'Input' to create arrays the the correct length for the number of floods the user chooses, but now I am filling those arrays with the timing and size values for the floods.

Basically I want the Input to say, "What is the magnitude (cfs) of flood number ...." and then say 1, 2, 3, 4 etc. I am using this within a looping construct that already has an iterator 'i' with the correct numerical value I want to be printed out on the 'Input' user interface. I just don't know how to incorporate this into "Input" along with the string of characters. Any suggestions are helpful thank you!

-Laura

POSTED BY: Laura McMullen
3 Replies

Thank you, these suggestions are very helpful.

POSTED BY: Laura McMullen

@Laura McMullen the first recommendation on a forum like this is to include some minimal exemplary code of yours to clarify the issue. Otherwise it is very hard to understand what do you need. Fro instance, you say:

Basically I want the Input to say, "What is the magnitude (cfs) of flood number ...." and then say 1, 2, 3, 4 etc.

But that is exactly what Input function documentation says how to do in first examples. Putting that in a loop:

enter image description here

Alternatively you could follow @Nasser M. Abbasi advice and use interface functionality:

Manipulate[x, {{x, .3, "Desnity"}, 0, 1, Appearance -> "Open"}]

enter image description here

Manipulate[x, {{x, .3, "Type value"}, 0, 1, InputField}]

enter image description here

POSTED BY: Sam Carrettie

Why not just use Manipulate and use all the controls that comes with it for input? There are sliders, pull down menus and many other controls. https://reference.wolfram.com/language/guide/ControlObjects.html

I can't help with the specific question you have there about "incorporate this into "Input" along with the string of characters." since I do not understand it. May be if you can specific example, of type of input and what you want for output, someone can help better.

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract