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

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)

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

This question is closed.

Products

Asked:

on 30 May 2012

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!