Info

This question is closed. Reopen it to edit or answer.

To form two cell arrays of same characters of same length and concatenate them

1 view (last 30 days)
Sir, I want to form an array of size 140X1. Out of which first 70 elements shall be a string of character 'genuine' and next 70 elements shall be a sring of characters 'forgery'. How can I do this?

Answers (1)

Andrei Bobrov
Andrei Bobrov on 30 May 2012
z = {'genuine';'forgery'};
out = z(kron([1;2],ones(70,1)));
or
out = z(reshape(repmat(1:2,70,1),[],1));
etc.

Products

Community Treasure Hunt

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

Start Hunting!