コンテンツへスキップ
MathWorks

Cody

  • ヘルプ センター
  • Cody の問題
  • MathWorks
  • MATLAB ヘルプ センター
  • コミュニティ
  • 学習
  • MATLAB を入手する MATLAB
  • サインイン
    • マイ アカウント
    • コミュニティのプロファイル
    • ライセンスを関連付ける

    • サインアウト
  • MathWorks サポートまでお問い合わせください
  • Visit mathworks.com
  • MATLAB Answers
  • File Exchange
  • Cody
  • AI Chat Playground
  • Discussions
  • Contests
  • Blogs
  • More
    • Communities
    • Treasure Hunt
    • People
    • Community Advisors
    • Virtual Badges
    • About
  • Home
  • Problem Groups
  • Problems
  • Players
  • More
    • Solutions
    • Recent Activity
  • Help

Problem 44886. Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}

Yoav Shallev
Yoav Shallev
161 solvers
0 likes
Solve
Solve Later

if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15].

if v1 is [1; 3; 5; 7] then v2 should be [4; 8; 12].

Solve

Solution Stats

354 Solutions

161 Solvers

Last Solution submitted on Dec 04, 2025

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers161

Pauli Huusari Riccardo G. Armando Longobardi Roberto

Suggested Problems

  • How many digits are there?

    273 Solvers

  • 04 - Scalar Equations 2

    540 Solvers

  • Rounding off numbers to n decimals

    5509 Solvers

  • Approximation of Pi

    1393 Solvers

  • Test Problem; Create a 5x5 array containing all ones

    405 Solvers

More from this Author4

  • Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.

    137 Solvers

  • Given a matrix A return a vector of the product of the elements in each column using a loop without using prod.

    151 Solvers

  • Given a matrix A (size m x n) create a matrix B (size m+2 x n+2) which consists of matrix A surrounded by zeros. See Example below:

    155 Solvers

  • Given a matrix A (size m x n) create a matrix B which consists of matrix A sorted in descending order by columns and then by rows.

    145 Solvers

Problem Tags

  • basics
  • vectors

Community Treasure Hunt

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

Start Hunting!
MathWorksMathWorks

Web サイトの選択

Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:

  • (English)
  • (Deutsch)
  • (Français)
  • (简体中文)
  • (English)

また、以下のリストから Web サイトを選択することもできます。

最適なサイトパフォーマンスの取得方法

中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。

南北アメリカ

  • América Latina (Español)
  • Canada (English)
  • United States (English)

ヨーロッパ

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

アジア太平洋地域

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文
    • English
  • 日本 (日本語)
  • 한국 (한국어)

最寄りの営業オフィスへのお問い合わせ

  • トラストセンター
  • 商標
  • プライバシー ポリシー
  • 違法コピー防止
  • アプリケーション ステータス
  • ご利用条件
  • Contact Us

© 1994-2026 The MathWorks, Inc.