answer = matrix2(matrix1 == number_of_interest)
Compare two matrices in Matlab
1 次查看(过去 30 天)
显示 更早的评论
- matrix1=[1:20]';
- matrix2=[21:40]';
- combined_matrix1_and_matrix2=[matrix1 matrix2];
If the value is equal to a number of matrix1, then show the number of matrix2. When the number isn´t shown in matrix1, then the programm give the answer ´error´
I don't know how to build this programm
- for example:
- the value is 13
- matrix1 has this number.
- the programm have to show the value: 33.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!