MATLAB Answers

Matlab function for defining the size of a matrix

조회 수: 56(최근 30일)
Priya
Priya 22 Jan 2014
댓글: Priya 22 Jan 2014
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.

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

Thomas
Thomas 22 Jan 2014
편집: Thomas 22 Jan 2014
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 22 Jan 2014
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.

댓글을 달려면 로그인하십시오.

태그


Translated by