Matlab function for defining the size of a matrix

12 ビュー (過去 30 日間)
Priya
Priya 2014 年 1 月 22 日
コメント済み: Priya 2014 年 1 月 22 日
The size of matrix A (in the model) is 14x14 B= 14x2 C= 14x14 D= 14x2
Now I need to know, how to use the function below to make the size of matrix B as 14x2
B=zeros(size(A,1),1)
Please drop your suggestions.

回答 (1 件)

Thomas
Thomas 2014 年 1 月 22 日
編集済み: Thomas 2014 年 1 月 22 日
B=zeros(size(A,1),2) % if you know A
B=zeros(size(D)) % if you know D
B=zeros(size(A,1),size(D,2)) % just to make it complicated
  1 件のコメント
Priya
Priya 2014 年 1 月 22 日
Thanks. But then I keep getting this error, Error in port widths or dimensions. Output port 1 of 'statespacemodel_hvm/Mux' is a one dimensional vector with 2 elements.
Error in port widths or dimensions. Input port 1 of 'statespacemodel_hvm/State-Space' has 3 elements. This port does not accept the dimensions (or orientation) specified by the input signal.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMath Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by