How do I extend cell to a larger dimension.
1 view (last 30 days)
Show older comments
I have a cell say A that I want to extend to the size of a larger cell, say B with special caracters, say 'n'. Similar to function padarray but with matrices. Say,
A = {'a','b';
'c','d'};
B = cell(3,4);
C = fun(A,size(B),'n')
gives
C = {'a','b','n','n';
'c','d','n','n';
'n','n','n','n' }
If it's not too much to ask I would like the MATLAB way to do it, either using indexing or a modification of padarray. Thank you.
0 Comments
Accepted Answer
Azzi Abdelmalek
on 18 Jul 2014
A = {'a','b';
'c','d'};
C = repmat({'n'},3,4)
[n,m]=size(A)
C(1:n,1:m)=A
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!