I'm trying to set up code that basically asks the user to input the values of a matrix with a certain key size. I want them to first enter the keysize and then ask for all of the entries necessary to fill the square matrix of that keysize.

  • $\begingroup$ Mathematica has already provided means to input a matrix. See e.g. reference.wolfram.com/language/howto/InputAMatrix.html $\endgroup$ Sep 27 '20 at 11:54
  • $\begingroup$ After you ask for the matrix size, you could present a TableView using the matrix size for the AllowedDimensions option. $\endgroup$ Oct 27 '20 at 15:03
  • $\begingroup$ Maybe one could used FormFunction, although it seem to be designed more for web applications. $\endgroup$ Mar 26 at 18:07

This is not an answer. This Code may help you prepare your input boxes.

country = 0;
sector = 0;
level = 0;
result = {};
While[Not[IntegerQ[country] && 1 <= country <= 64], (country = Input["Which country do you want to analyze?"])];
While[Not[IntegerQ[sector] && 1 <= sector <= 15], (sector = Input["Which sector do you want to target?"])];
While[Not[NumericQ[level] && 0.01 <= level <= 1], (level = Input["At what significance level do you want to analyze IO matrix?"])];
result = {country, sector, level};
 result === {}, "",

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.