How to assign a string with a value in repmat?

5 Ansichten (letzte 30 Tage)
Samuel Davies
Samuel Davies am 15 Sep. 2015
Kommentiert: Samuel Davies am 16 Sep. 2015
I have a value, A = -1. I want to use repmat as so:
B = repmat('A',1,2);
but this gives me [A,A] and not [-1,-1] as I want it to. Seems very simple but I cannot get it. Help please. Thank you.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 15 Sep. 2015
B = repmat(A,1,2)

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays 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