필터 지우기
필터 지우기

How to delete certain data corresponding of other value?

조회 수: 1 (최근 30일)
hj lee
hj lee 2020년 6월 11일
댓글: hj lee 2020년 6월 12일
Hello,
Here is the example data.
a = [1 2 3 4 5 6 7 8 9 10];
b = [2.5 3.5 4.5];
c = a.*b;
the mablab can't calculate this since the number of data aren't same... so I want to delete
some data a, and I want to make a = [8 9 10]
but, the problem is a and b are depend on what I put the first initial conditions,
so it can be
a = [2 3 4 5 6 7 8 9 10 11];
b = [3.5 4.5];
in this situation, I want to make a = [10 11] (delete the data from the first value)
how to make matlab code which correspond the data automatically?

채택된 답변

KSSV
KSSV 2020년 6월 11일
n = length(b) ;
a = a(end-(n-1):end)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by