I have 4 arrays, two combinations of Nwell and Pwell voltages of Transistor 1 and Transistor 2
For transistor 1
vnw_1 =
0.00000 0.90000
vpw_1 =
-1.8000 -1.2000
So we define as (Vn, Vp) as (0.00000, -1.8000) and another (0.90000, -1.2000) these are the combination respectively.
for transistor 2
vnw_2 =
0.90000 0.00000
vpw_2 =
-1.20000 0.20000
Similarly we have (Vn, Vp) as (0.90000, -1.2000) and another (0.00000, 0.20000)
we can see that (0.90000, -1.2000) is common in T1 and T2.
I want to get the common voltage as the output
Answer (0.90000, -1.2000)
How do i do that? There is nothing linked to the concepts of transistors, just i need that combination as the output. How do i do that? Please help me

 採用された回答

David Hill
David Hill 2020 年 5 月 27 日

0 投票

Not sure how you are getting your data. Generally, you would not want to use so many variables but rather index into a single variable.
A=[vnw_1;vpw_1]';
B=[vnw_2;vpw_2]';
C=A(ismember(A,B,'rows'),:);

8 件のコメント

Ganesh Kini
Ganesh Kini 2020 年 5 月 27 日
It is not working , can you suggest one more solution.
David Hill
David Hill 2020 年 5 月 27 日
A=[0.00000 0.90000; -1.8000 -1.2000]';
B=[ 0.90000 0.00000; -1.20000 0.20000]';
C=A(ismember(A,B,'rows'),:);
Provides output:
C =
0.9000 -1.2000
Ganesh Kini
Ganesh Kini 2020 年 5 月 27 日
編集済み: Ganesh Kini 2020 年 5 月 27 日
vnw_1 = [0.00000, 0.90000];
vpw_1 = [-1.80000, -1.20000];
vnw_2 = [0.90000, 0.00000];
vpw_2 = [-1.20000, 0.20000];
A = [vnw_1; vpw_1];
B = [vnw_2; vpw_2];
C = A (ismember (A, B, 'rows' ), :);
disp (C)
i executed the code and this is the result
C =
0 × 2 empty double matrix
David Hill
David Hill 2020 年 5 月 27 日
A = [vnw_1; vpw_1]';%need ' since it is comparing rows
B = [vnw_2; vpw_2]';%need ' since it is comparing rows
Stephen23
Stephen23 2020 年 5 月 28 日
To avoid floating point issues it would be more reliable to use ismembertol:
Ganesh Kini
Ganesh Kini 2020 年 5 月 28 日
Hi,
Thanks for all the suggestions, It works, But what if it has different dimensions ?
VNW1
-0.20000 -0.20000
vpw1 =
-0.90000 -1.80000
VNW2 =
1.20000 0.30000 0.90000 -0.20000 1.20000
VPW2=
0.00000 -1.20000 -0.90000 -1.80000 -0.30000
Could you please help ?
Rik
Rik 2020 年 5 月 28 日
Please stop double-posting.
Ganesh Kini
Ganesh Kini 2020 年 5 月 28 日
@Rik Just wanted to know different approaches to solve the issue.
Thanks for the help it works fine

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by