assign values for the list of numbers in the column from a look up lable

1 回表示 (過去 30 日間)
JL
JL 2019 年 8 月 2 日
コメント済み: JL 2019 年 8 月 8 日
I have a table
x = [10; 20; 30; 40; 50;]; %look up table
and i have y =
1
4
5
and I want to assign 1=10; 4=40; 5=50;
and so if i have new values of y =
2
5
then I assign 2=20; 5=50;

採用された回答

Walter Roberson
Walter Roberson 2019 年 8 月 2 日
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 8 月 2 日
[y, x(y)]
Provided that x and y are both column vectors like you show in your question.
JL
JL 2019 年 8 月 8 日
Hi Walter, I have another intetesting problem, was wondering if you are interested to take a look - here is the link to the question https://uk.mathworks.com/matlabcentral/answers/475460-sharing-values-of-elements-in-a-matrix

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

その他の回答 (1 件)

JL
JL 2019 年 8 月 2 日
Thanks Walter, it is working!

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by