Write function to expand array and average adjacent entries.

조회 수: 7 (최근 30일)
Ashley
Ashley 2012년 10월 16일
Write a function twice.m: function y = twice(x) ... end which expands the input signal by inserting the average of the adjacent entries. For example, >> twice([1 5 2 4]) ans = 1 3 5 3.5 2 3 4 You are not allowed to use for-loop in this problem.

채택된 답변

Matt J
Matt J 2012년 10월 16일
Hint: interp1

추가 답변 (2개)

Matt Fig
Matt Fig 2012년 10월 16일
편집: Matt Fig 2012년 10월 16일
Please show what you have done so far for your homework problem....
The more effort you show, the more help you will likely get.

Sean de Wolski
Sean de Wolski 2012년 10월 16일

카테고리

Help CenterFile Exchange에서 Array Geometries and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by