mapping matrix of two vectors
7 次查看(过去 30 天)
显示 更早的评论
Hi,
If I have two vectors and as shown below. Is there a way to create matrix that mapps each row of A with its correspondent in B? In other words, check row by row of both A and B. Row 1 in A has the value of 1 and corresponds to value of 3 in B, then put one, otherwise put zero.
Thanks.
0 个评论
采纳的回答
Davide Masiello
2022-4-7
clear,clc
A = [1;2;3;4];
B = [3;1;4;2];
C = A == B'
1 个评论
Rajiuddin Sk
2023-2-1
Dear Davide,
When the matrix A and B contains symbols, then MATLAB could not find the transformation matrix in above mention method. Can you say how to find the transformation matrix in case of symbolic matrix?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!