You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Excel中生成旋转90度的酉矩阵?能否通过单元格公式实现?

Generate a 90-Degree Rotated Unitary Matrix in Excel with Array Formulas

Absolutely, you can create the exact rotated unitary matrix you’re looking for directly using Excel’s built-in functions—no pre-written matrices required. Let’s walk through how to do this, tailored to your 3阶 example and scalable to any size.

The Core Approach

You already know MUNIT(size) generates a standard unitary (identity) matrix. The target matrix you want is essentially the identity matrix with its rows reversed (which matches your 3阶 example: [0,0,1]; [0,1,0]; [1,0,0]). We can use Excel’s INDEX and SEQUENCE functions to dynamically reverse the row order of the MUNIT output.

The Array Formula

For an n-sized matrix, use this formula:

=INDEX(MUNIT(n), SEQUENCE(n, 1, n, -1), SEQUENCE(n))

Breakdown of the Formula:

  • MUNIT(n): Generates the standard n×n identity matrix.
  • SEQUENCE(n, 1, n, -1): Creates a descending sequence from n to 1 (e.g., for n=3, this outputs 3,2,1). This tells INDEX to pull rows from the identity matrix in reverse order.
  • SEQUENCE(n): Creates an ascending sequence from 1 to n, which selects all columns in each reversed row.

Example for 3阶 Matrix

If you input =INDEX(MUNIT(3), SEQUENCE(3,1,3,-1), SEQUENCE(3)) into a 3×3 cell range (as an array formula), you’ll get exactly the matrix you specified:

0 0 1
0 1 0
1 0 0

Notes for Usage:

  • Excel Versions: This works natively in Excel 365/2021 with dynamic arrays (just press Enter). For older versions, you’ll need to enter it as an array formula using Ctrl+Shift+Enter.
  • Scalability: Change the n value to generate any size of the rotated matrix—no manual edits needed.

内容的提问来源于stack exchange,提问作者zexot

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:44:27