Write a function halfway(n) that given an odd integer n as input, returns the integer that’s halfway between 1 and n. >> halfway(9) ans = 5

1 回表示 (過去 30 日間)
plz help

採用された回答

KSSV
KSSV 2018 年 9 月 20 日
N = 9 ;
x = round(mean(1:N))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by