|
|
|
fill up matrix with zeros |
|
| benlec |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 04.07.2012, 10:00
Titel: fill up matrix with zeros
|
 |
how can fill up a matrix A with zeros up to the dimension of a matrix B
e.g.: A is 2x3 matrix filled with numbers, and B is zeros(4,4) and I want the matrix A within matrix B so that C=[A11 A12 A13 0; A21 A22 A23 0; 0 0 0 0; 0 0 0 0]?
anyone knows a solution without a loop?
|
|
|
|
|
|
| Kascho |

Forum-Century
|
 |
Beiträge: 195
|
 |
|
 |
Anmeldedatum: 24.03.10
|
 |
|
 |
Wohnort: Jena
|
 |
|
 |
Version: R2008b ... :(
|
 |
|
|
 |
|
Verfasst am: 04.07.2012, 10:43
Titel:
|
 |
Hi benlec,
maybe you try this:
you dont need to use the size function, but that makes it more variable
|
|
|
|
| Jan S |

Moderator
|
 |
Beiträge: 11.057
|
 |
|
 |
Anmeldedatum: 08.07.10
|
 |
|
 |
Wohnort: Heidelberg
|
 |
|
 |
Version: 2009a, 2016b
|
 |
|
|
 |
|
Verfasst am: 04.07.2012, 13:45
Titel: Re: fill up matrix with zeros
|
 |
Dear benlec,
The language of this forum is German. I do not think that an English question bothers, but I assume you get more answers in an English speaking forum.
Gruß, Jan
|
|
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|