Change Matrix dimension with NaN
Show older comments
Hi guys,
After extracting some data the result is something like this:
h=[ 2 3 4, 5 6 , 7 8 9]
which is wrong and therefore an error appears because the matrix has to be square.
My question is, how can i fullfill the empty spaces in h with NaN.
Can anyone help?
Thanks in advance!
Inês
1 Comment
Azzi Abdelmalek
on 22 Jul 2015
How your data are stored?
Answers (1)
bio lim
on 22 Jul 2015
a = [2 3 4]:
b = [5 6];
c = [7 8 9];
h = padcat(a,b,c)
And your h will be
h = [2 3 4; 5 6 NaN; 7 8 9]
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!