MATLAB Answers

How Can I convert a 1 by 1 array into multidimensional array?

2 views (last 30 days)
Ganesh kumar Badri narayan
Answered: Walter Roberson on 5 Jul 2017
For example i have
a=[1]
I want to convert it into
a=[1111 1111 1111
1111 1111 1111
1111 1111 1111]
Can anyone please help me here.

  0 Comments

Sign in to comment.

Answers (2)

Star Strider
Star Strider on 5 Jul 2017
One approach:
a = [1];
a = a*ones(1, 36);
a = reshape(a, [], 4);

  0 Comments

Sign in to comment.


Walter Roberson
Walter Roberson on 5 Jul 2017
repmat(a, 3, 4, 3)
perhaps

  0 Comments

Sign in to comment.

Sign in to answer this question.