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

조회 수: 3 (최근 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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by