0

I want to create a matrix using QP = [20 22 28 35 50]

and make:

x = [20, 22, 28, 35, 50;
20, 22, 28, 35, 50;
20, 22, 28, 35, 50;]

I know how to make it manually, but I am looking for an efficient way to create such example.

Thanks

1 Answer 1

2

Use repmat to repeat copies of array:

x = repmat(QP, 3, 1)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @herohuyongtao

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.