{
"id": "fn-matrix-transpose",
"dataComponent": "matrix",
"heading": {
"title": "transpose",
"badges": [
"Matrix",
"PARTIAL"
]
},
"synopsis": "Returns the transpose of a 2D array (rows become columns, columns become rows). Supports partial usage for the matrix.",
"codeBlocks": [
"extend(\"matrix\")\n\n# 1) Basic usage => 2×2\nA = [[1,2],[3,4]]\nT = matrix:transpose(A)\n# => [[1,3],[2,4]]\nsput(T)\n\n# 2) Floats => same concept\nF = [[1.1,2.2],[3.3,4.4]]\nsput( matrix:transpose(F) )\n# => [[1.1,3.3],[2.2,4.4]]\n\n# 3) Partial usage => only one argument is known\npart = matrix:transpose()\nres = part([[10,20],[30,40]])\nsput(res)\n# => [[10,30],[20,40]]\n\n# If the array is not recognized as int2d or float2d, or dimension is 0, result or error depends on bridging.\n"
],
"notes": [
"Takes 0 or 1 arguments. If zero, partial usage is returned, expecting the actual 2D array next.",
"Returns a new 2D array with rows and columns swapped. If A is M×N, the result is N×M.",
"Works with int2d_array or float2d_array. If shape is irregular or data is not 2D, bridging might raise an error."
]
}