列自定義公式我想通過以下計算在我的表中添加一個新列“Vth”:-
首先,我需要找到“Id”列最接近 1e-6 的索引 i;然後 Vth = Vg(i)。 它也應該按 Mod 和 Device 列分組。 也就是說,Mod 和 Device 的每個唯一組合將具有一個 Vth 值。
| ID | Vg | 模組 | 設備 | Vth |
| 2.00E-06 | 3 | 1A | X1 | |
| 2.00E-07 | 2.8 | 1A | X1 | |
| 2.00E-08 | 2.6 | 1A | X1 | |
| 2.00E-09 | 2.4 | 1A | X1 | |
| 2.00E-10 | 2.2 | 1A | X1 | |
| 2.00E-12 | 2 | 1A | X1 | |
| 3.00E-06 | 3 | 1B | X1 | |
| 3.00E-07 | 2.8 | 1B | X1 | |
| 3.00E-08 | 2.6 | 1B | X1 | |
| 3.00E-09 | 2.4 | 1B | X1 | |
| 3.00E-10 | 2.2 | 1B | X1 | |
| 3.00E-12 | 2 | 1B | X1 | |
| 4.00E-06 | 3 | 1A | Y1 | |
| 4.00E-07 | 2.8 | 1A | Y1 | |
| 4.00E-08 | 2.6 | 1A | Y1 | |
| 4.00E-09 | 2.4 | 1A | Y1 | |
| 4.00E-10 | 2.2 | 1A | Y1 | |
| 4.00E-12 | 2 | 1A | Y1 | |
| 5.00E-06 | 3 | 1B | Y1 | |
| 5.00E-07 | 2.8 | 1B | Y1 | |
| 5.00E-08 | 2.6 | 1B | Y1 | |
| 5.00E-09 | 2.4 | 1B | Y1 | |
| 5.00E-10 | 2.2 | 1B | Y1 | |
| 5.00E-12 | 2 | 1B | Y1 | |
數據表腳本回复:列自定義公式以下是生成您要求的內容的列。我按原樣採用了您的插值公式,並實施了它。您可能需要更改一些內容。
Names default to Here(1);
// Create the sample data table
dt=New Table( "Example",
Add Rows( 24 ),
New Column( "ID",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.000002, 0.0000002, 0.00000002, 0.000000002, 0.0000000002,
0.000000000002, 0.000003, 0.0000003, 0.00000003, 0.000000003,
0.0000000003, 0.000000000003, 0.000004, 0.0000004, 0.00000004,
0.000000004, 0.0000000004, 0.000000000004, 0.000005, 0.0000005,
0.00000005, 0.000000005, 0.0000000005, 0.000000000005]
)
),
New Column( "VG",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4,
2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2]
)
),
New Column( "Mod",
Character( 16 ),
"Nominal",
Set Values(
{"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B",
"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B"}
)
),
New Column( "Device",
Character( 16 ),
"Nominal",
Set Values(
{"X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1",
"Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1"}
)
)
);
// Find the index
dt << New Column("Row", formula(
theMin = Col Minimum( Abs( 0.000001 - :ID ), :Mod, :Device );
theValue = .;
If( Abs( 0.000001 - :ID[Row()] ) == theMin,
show(.000001 - :ID[Row()]);
theValue = Row()
);));
dt<<NEW column=""> 0,
iRow = theRow - 1,
.000001 - :ID[theRow] < 0,
iRow = theRow +1,
iRow = theRow
);
);
));
iRow;
// Set the Vth
dt<<NEW column=""></NEW></NEW>回复:列自定義公式謝謝吉姆。 有用。 如何修改它以找到 Vth通過插值恰好對應於 ID 的 1e-6。 即在 ID 的 1e-6 之前和之後找到一個索引,然後進行插值。
index=最接近 1e-6(大於 1e-6)
插值(x, [VG(index) VG(index-1)], [log10(ID(index)) log10(ID(index-1))]);
回复:列自定義公式這是一個小腳本,它創建 2 個新列,為您提供所需的結果。下圖已刪除臨時列,因為它只是一個工作列。
Names default to Here(1);
// Create the sample data table
dt=New Table( "Example",
Add Rows( 24 ),
New Column( "ID",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.000002, 0.0000002, 0.00000002, 0.000000002, 0.0000000002,
0.000000000002, 0.000003, 0.0000003, 0.00000003, 0.000000003,
0.0000000003, 0.000000000003, 0.000004, 0.0000004, 0.00000004,
0.000000004, 0.0000000004, 0.000000000004, 0.000005, 0.0000005,
0.00000005, 0.000000005, 0.0000000005, 0.000000000005]
)
),
New Column( "VG",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4,
2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2]
)
),
New Column( "Mod",
Character( 16 ),
"Nominal",
Set Values(
{"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B",
"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B"}
)
),
New Column( "Device",
Character( 16 ),
"Nominal",
Set Values(
{"X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1",
"Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1"}
)
)
);
// Find the index
dt << New Column("Row", formula(
theMin = Col Minimum( Abs( 0.000001 - :ID ), :Mod, :Device );
theValue = .;
If( Abs( 0.000001 - :ID[Row()] ) == theMin,
theValue = Row()
);));
// Set the Vth
dt<<NEW column=""></NEW>