필터 지우기
필터 지우기

outputting the left side of pairs in array

조회 수: 1 (최근 30일)
Mohamed Jamal
Mohamed Jamal 2020년 7월 19일
답변: madhan ravi 2020년 7월 19일
Hi guys, I have an array for instance y=[1 2 3 4 5 6]
I want to output the values that its indexes are the middle of the left side and right of every pair with increasing index (I mean at index=1 and index=3 then the middle between is at index=2 , then I look at index=3 etc ..), this mean I look at 1 3 and the value 2 is the middle between those two pair, then I look on the other pair 3 5 and I print the value 4 ..etc
so my output in my case is an array that have the values that are the middle of every pair , in my case output=[2 4 5]
so how could I implement that in matlab? thanks alot for your help!
  댓글 수: 7
KSSV
KSSV 2020년 7월 19일
Write your expected output.....[2 4 5]?
jonas
jonas 2020년 7월 19일
perhaps you want to exclude the two edge values?

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

답변 (1개)

madhan ravi
madhan ravi 2020년 7월 19일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by