this is my code and it has a problem while calculating kafa=y2/y12

kafa=y2/y12. but it gives error.. Matrix dimensions must agree.

4 commentaires

You probably need y1./y12
sir there is no y1 in this code.it should be undefined if i do so
You probably need y2./y12
but it gives error.. dimensions must agree

Connectez-vous pour commenter.

 Réponse acceptée

per isakson
per isakson le 17 Jan 2018
Modifié(e) : per isakson le 17 Jan 2018
Error using /
Matrix dimensions must agree.
>> whos y2 y12
Name Size Bytes Class Attributes
y12 1x450 3600 double
y2 15x1 120 double
>>

9 commentaires

how to deal with it sir?how to solve this problem now?
  • What is your intention?
  • What is kafa supposed to become? I don't know!
per isakson
per isakson le 17 Jan 2018
Modifié(e) : per isakson le 17 Jan 2018
Moved OP's answer to here
y2 is the experimental value while y12 is the theoritical values and i just wanna divide y2 by y12....
sir i couldn't find your answer. can you please kindly send it?
per isakson
per isakson le 17 Jan 2018
Modifié(e) : per isakson le 17 Jan 2018
Try
>> figure, plot( y2, 'd' )
>> figure, plot( y12, '.' )
Division between a column vector and a row vector of different length. we are not concerend with pt while calcualtiong because we already have the value of y12 and y2 but the column vector and row vector are different nd it gives error
I don't understand the meaning of your comment.
It would help if you make an implementation based on nested for-loops.

Connectez-vous pour commenter.

Plus de réponses (2)

bsxfun(@rdivide,A,B(:))... this can solve my problem but the number of elements in row and column are different now. so what can i do for this problem?
sir, y2 is 15x1 while y12 is 450x1, kafa=y2/y12. i need the result of y2/y12. i mean, row to column division,not elementwise division. y2 has 15 rows while y12 has 450 columns. now i need to divide these 15 rows of y2 by 15 columns of y12.

Catégories

En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by