Saltar al contenido
MathWorks

Cody

  • Centro de ayuda
  • Problemas de Cody
  • MathWorks
  • Centro de ayuda de MATLAB
  • Comunidad de usuarios
  • Aprendizaje
  • Obtenga MATLAB MATLAB
  • Inicie sesión
    • Mi Cuenta
    • Mi perfil de la comunidad
    • Asociar Licencia

    • Cerrar sesión
  • Comuníquese con el soporte de 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 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
155 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

530 Solutions

155 Solvers

Last Solution submitted on Nov 19, 2024

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers155

Pauli Huusari Riccardo G. CXD Kate

Suggested Problems

  • Determine whether a vector is monotonically increasing

    22843 Solvers

  • Replace Vector Elements

    509 Solvers

  • Divisors of an integer

    194 Solvers

  • Reverse the elements of an array

    1109 Solvers

  • modulus of a number

    227 Solvers

More from this Author4

  • 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

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

    161 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

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

    137 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

Seleccione un país/idioma

Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .

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

También puede seleccionar uno de estos países/idiomas:

Cómo obtener el mejor rendimiento

Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.

América

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

Asia-Pacífico

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

Comuníquese con su oficina local

  • Centro de confianza
  • Marcas comerciales
  • Política de privacidad
  • Antipiratería
  • Estado de las aplicaciones
  • Términos de uso
  • Contact Us

© 1994-2026 The MathWorks, Inc.