Skip to main content
added 362 characters in body; added 12 characters in body
Source Link
Rojo
  • 42.8k
  • 7
  • 98
  • 190

It's not possible because it makes as much sense as wanting to have list of n elements with n being undefined. ButThe most similar thing you can always do something like the followingis to have a symbolic representation of that, that evaluates to what you want when n gets a numeric value. For that, you can either define your own

myTable[exp_symbolicTable[exp_, it:{_, __?NumericQ| _List}]:=Table[exp, it]

If you then use myTablesymbolicTable just like Table, it will only evaluate when the iterator bounds are numeric and remain unevaluated when they are not.

ooor, just turn off the warning message you get when you try to use Table with a non-numeric argument

Off[Table::iterb]

It's not possible. But you can always do something like the following

myTable[exp_, it:{_, __?NumericQ| _List}]:=Table[exp, it]

If you then use myTable just like Table, it will only evaluate when the iterator bounds are numeric and remain unevaluated when they are not

It's not possible because it makes as much sense as wanting to have list of n elements with n being undefined. The most similar thing you can do is to have a symbolic representation of that, that evaluates to what you want when n gets a numeric value. For that, you can either define your own

symbolicTable[exp_, it:{_, __?NumericQ| _List}]:=Table[exp, it]

If you then use symbolicTable just like Table, it will only evaluate when the iterator bounds are numeric and remain unevaluated when they are not.

ooor, just turn off the warning message you get when you try to use Table with a non-numeric argument

Off[Table::iterb]
Source Link
Rojo
  • 42.8k
  • 7
  • 98
  • 190

It's not possible. But you can always do something like the following

myTable[exp_, it:{_, __?NumericQ| _List}]:=Table[exp, it]

If you then use myTable just like Table, it will only evaluate when the iterator bounds are numeric and remain unevaluated when they are not