Vector addition - MATLAB Cody - MATLAB Central

Problem 42984. Vector addition

  • Created by HH
Difficulty:Rate

Given two row vectors, v1 and v2, each representing an integer, such that the vector elements are the digits from left to right, return a row vector v3, of the same format, that represents the sum of the integers represented by v1 and v2.

Example 1:

v1 = [1 4]

v2 = [3 8 6 1]

v3 = [3 8 7 5]

Example 2:

v1 = [9 9]

v2 = [9 9]

v3 = [1 9 8]

Solution Stats

33.1% Correct | 66.9% Incorrect
Last Solution submitted on Dec 17, 2024

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
14
6

Problem Recent Solvers33

Suggested Problems

More from this Author45

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page