Weiter zum Inhalt
MathWorks

Cody

  • MATLAB Hilfe-Center
  • Community
  • Lernen
  • MATLAB erhalten MATLAB
  • Melden Sie sich an
    • Eigener Account
    • Mein Community Profil
    • Lizenz zuordnen

    • Abmelden
  • Wenden Sie sich an den MathWorks Support
  • 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 44887. 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:

Yoav Shallev
Yoav Shallev
157 solvers
1 likes
Solve
Solve Later

A =
[1 2 3
4 5 6]
-----------
B =
[0 0 0 0 0
0 1 2 3 0
0 4 5 6 0
0 0 0 0 0]
Solve

Solution Stats

532 Solutions

157 Solvers

Last Solution submitted on May 30, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers157

Chris Cleveland Riccardo G. Kate Lorenzo

Suggested Problems

  • Binary numbers

    4864 Solvers

  • Is my wife right?

    17455 Solvers

  • Find the maximum number of decimal places in a set of numbers

    3560 Solvers

  • Compare two input matrices

    375 Solvers

  • Find the sum of n squares

    210 Solvers

More from this Author4

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

    163 Solvers

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

    153 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.

    147 Solvers

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

    139 Solvers

Problem Tags

  • basic matlab
  • matrix manipulation

Community Treasure Hunt

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

Start Hunting!
MathWorksMathWorks

Website auswählen

Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .

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

Sie können auch eine Website aus der folgenden Liste auswählen:

So erhalten Sie die bestmögliche Leistung auf der Website

Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.

Amerika

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

Europa

  • 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)

Asien-Pazifik

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

Kontakt zu Ihrer lokalen Niederlassung

  • Trust Center
  • Handelsmarken
  • Datenschutz-Richtlinien
  • Datendiebstahl verhindern
  • Status von Anwendungen
  • Nutzungsbedingungen
  • Contact Us

© 1994-2026 The MathWorks, Inc.