Changes in vectors

조회 수: 3 (최근 30일)
Cillian
Cillian 2012년 5월 7일
Hello again.
This is perhaps more a logic question,
If I got measure points at the time t is wrong, and the correct ones is in a vector L_New that has 10 x 1.
How do I do to change the wrong measure points in L to be correct?
I know that I have not post my attempt, but this is more a "thinking" question.
Anyhow, I would be please if someone can tell me how it works.
Best Regards Cillian

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 5월 7일
This sounds like you may eventually want to interpolate. Do do this, in this case, look into interp1. If you provide us with a small set of sample data we might be better able to help you.
  댓글 수: 2
Cillian
Cillian 2012년 5월 8일
L =[0:10];
L_New =[0:10]';
yi = interp1(L,L_New,'nearest')
% The question is not so clear about if L have the same size or a different size.
Cillian
Cillian 2012년 5월 10일
Ops, I forgot to add the results:
yi =
NaN
0
1
2
3
4
5
6
7
8
9

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Stefan
Stefan 2012년 5월 7일
Are the measure points located in a vector with the same size like L_New? Or do you have more values?
Same size: Why do you not copy L_New? L=L_New;
Different size: you have to find first the wrong values in L, before you can compare them to L_New and exchange them.
  댓글 수: 1
Cillian
Cillian 2012년 5월 8일
Sorry, I don't know. The question is not so clear about if L have the same size or a different size.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by