Filter löschen
Filter löschen

concatenated matrix - factoring out a matrix coefficient

2 Ansichten (letzte 30 Tage)
Viesturs Veckalns
Viesturs Veckalns am 16 Okt. 2017
Bearbeitet: Cedric am 16 Okt. 2017
A, B and C are MxN matrices. I construct a matrix D in the following way:
D = [A./C, B./C]
It is inviting to bring out the coefficient ./C
D = [A, B]./C
however this change conflicts Matlab rules [A, B] being an Mx2N matrix and ./C being an MxN matrix.
Is there a convenient way in Matlab to factor out a matrix coefficient?

Akzeptierte Antwort

Cedric
Cedric am 16 Okt. 2017
Bearbeitet: Cedric am 16 Okt. 2017
D = [A, B]./[C, C]
which isn't more convenient than the initial expression! Depending the context, you can REPELEM or REPMAT C as many times as necessary if this is not always 2, but there is no easy shortcut or simple automatic expansion that I can think of.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by