フィルターのクリア

Compare two matrices in Matlab

1 回表示 (過去 30 日間)
Marcel Been
Marcel Been 2014 年 8 月 18 日
回答済み: Iain 2014 年 8 月 18 日
  • 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.

採用された回答

Iain
Iain 2014 年 8 月 18 日
answer = matrix2(matrix1 == number_of_interest)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by