How to assign a string with a value in repmat?

조회 수: 3 (최근 30일)
Samuel Davies
Samuel Davies 2015년 9월 15일
댓글: Samuel Davies 2015년 9월 16일
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.

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 15일
B = repmat(A,1,2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by