dimension consistency of matrix

2 次查看(过去 30 天)
Tino
Tino 2019-5-14
回答: Raj 2019-5-14
Hello
I have 2 columns
A B
1 2
2 4
3 3
4 1
6
1
3
4
5
6
How do I make B the same size as A by completting the length with zero to make it the same dimension
Thanks advance

回答(1 个)

Raj
Raj 2019-5-14
A=[1;2;3;4;6;1;3;4;5;6]
B=[2;4;3;1]
B= [B;zeros(numel(A)-numel(B),1)]

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by