SquareRepeatingElement[spec]
represents a square array of elements of type spec in an interpreter, API or form specification.
SquareRepeatingElement[spec,max]
represents a square array of elements of maximum size max×max.
SquareRepeatingElement[spec,{min,max}]
represents a square array of elements of size between min and max.
SquareRepeatingElement
SquareRepeatingElement[spec]
represents a square array of elements of type spec in an interpreter, API or form specification.
SquareRepeatingElement[spec,max]
represents a square array of elements of maximum size max×max.
SquareRepeatingElement[spec,{min,max}]
represents a square array of elements of size between min and max.
Details
- In the context of Interpreter, spec can be any specification used for Interpreter, including CompoundElement or RepeatingElement.
- In the context of FormObject and FormFunction, spec can be any specification used for forms, including the full association.
Examples
open all close allBasic Examples (3)
Use SquareRepeatingElement to interpret a square matrix of data:
Interpreter[SquareRepeatingElement["Number"]][{{"1.1", "3.2"}, { "32", "22.2"}}]SquareRepeatingElement fails on data that is not square:
Interpreter[SquareRepeatingElement["Number"]][{{"1", "2.5", "3.2"}, {"11", "15", "12.2"}}]Use it in an APIFunction to collect complex data:
api = CloudDeploy @ APIFunction[
"data" -> SquareRepeatingElement["Integer"],
Det[#data]&,
AllowedCloudParameterExtensions -> {"json"}
]URLExecute[api, {"data__json" -> "[[1, 2], [3, 4]]"}]Scope (2)
The second argument is used to limit the size of the input:
Interpreter[SquareRepeatingElement["Integer", 2]][{{"1", "2", "3"}, {"11", "22", "33"}, {"111", "222", "333"}}]Interpreter[SquareRepeatingElement["Integer", 2]][{{"1", "2"}, {"3", "4"}}]Limit the minimum size of the array:
Interpreter[SquareRepeatingElement["Integer", {2, 100}]][{{"1"}}]Interpreter[SquareRepeatingElement["Integer", {2, 100}]][{{"1", "2"}, {"3", "4"}}]Properties & Relations (3)
SquareRepeatingElement can be used in conjunction with any interpreter specification:
Interpreter[SquareRepeatingElement["Integer" | "Country"]][{{"15", "burkina faso"}, {"chad", "5"}}]Including RepeatingElement:
Interpreter[SquareRepeatingElement[RepeatingElement["Number"]]][{{{"1", "2", "3"}, {"1"}}, {{"5", "6"}, {"7"}}}]And CompoundElement:
Interpreter[SquareRepeatingElement[CompoundElement[<|"country" -> "Country", "city" -> "City"|>]]][{{<|"country" -> "argentina", "city" -> "dubai"|>, <|"city" -> "bangalore", "country" -> "usa"|>}, {<|"country" -> "angola", "city" -> "lahore"|>, <|"city" -> "bangkok", "country" -> "canada"|>}}]Possible Issues (1)
Constructs like FormFunction and FormPage do not show a special interface for SquareRepeatingElement:
CloudDeploy[
FormFunction["data" -> SquareRepeatingElement["Integer"],
Det[#data]&
]]Related Guides
History
Text
Wolfram Research (2017), SquareRepeatingElement, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareRepeatingElement.html.
CMS
Wolfram Language. 2017. "SquareRepeatingElement." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SquareRepeatingElement.html.
APA
Wolfram Language. (2017). SquareRepeatingElement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SquareRepeatingElement.html
BibTeX
@misc{reference.wolfram_2026_squarerepeatingelement, author="Wolfram Research", title="{SquareRepeatingElement}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/SquareRepeatingElement.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_squarerepeatingelement, organization={Wolfram Research}, title={SquareRepeatingElement}, year={2017}, url={https://reference.wolfram.com/language/ref/SquareRepeatingElement.html}, note=[Accessed: 12-June-2026]}