Matlab Subscripted assignment dimension mismatch error -


i'm trying perform row multiplication 2 matrices: a , b.

a subscripted assignment dimension mismatch error thrown on line c(1,i) = a(i,:)*b;.

do have syntax error causing dimensions on left , right sides of = sign unequal?

function c = rowproduct(a,b)  [n,m]=size(a); [p,q]=size(b);  c=zeros(1,n);  if( m == p)     i=1:n         c(1,i) = a(i,:)*b;     end else     error('matrix dimension mismatch'); end end 

try replace c(1,i) = a(i,:)*b; c(i,:) = a(i,:)*b;


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -