0

I have 4 row vectors with different dimensions and i want to present them as one matrix. Can anyone tell me how to do it?

Here is what I mean.

clear 
b1 = fir1(24,[0.5 0.9]);


f=[0 0.6 0.6 0.8 0.8 1];
m=[0 0 1 1 0 0];

b2=fir2(24,f,m)

[b3,a3] = butter(4,[0.6 0.8]);

[b8,a8] = butter(4,[2*pi*900 2*pi*1200],'s');
[b4,a4] = impinvar(b8,a8,3000);

A=[b1;b2;a3;b3;a4;b4]

Evaluating this I got the following error:

Error using vertcat
Dimensions of arrays being concatenated are not consistent.

This is because b1 and b2 are 1x25 while a3, b3, a4, b4 are 1x9. I believe this can be fixed by adding NaN values into the latter, but I don't know how.

Scavenger23
  • 209
  • 1
  • 6
  • What's your expected output? It has to be regular (all rows have the same number of columns), so show what you expect/hope for... – Wolfie Jan 09 '19 at 16:05
  • 1
    If you do `A={b1;b2;a3;b3;a4;b4}`, the linked duplicate is exactly this question – Sardar Usama Jan 09 '19 at 16:09

0 Answers0