How to use reshape function in this situation ?

I have two matrices their info shown as the following:
% 1st Matrix info
Name Size Bytes Class Attributes
X 1x3 24 double
% 2nd Matrix info
Name Size Bytes Class Attributes
Y 19830x4 634560 double
How can I apply reshape function to execute a dot product between these matrices ?
Main goal: X and Y must have the same size !!!

Respuestas (1)

Guillaume
Guillaume el 29 de Feb. de 2016

0 votos

Forgetting about the shape for the moment, in order to execute a dot product each argument must have the same number of elements. One of your matrix has 3 elements, the other over 79000.
You can reshape all you want, you'll never be able to perform a dot product between these two matrix.
Rather than asking us to solve an unsolvable problem, why don't you tell us what is the real problem? What is the end goal?

5 comentarios

Susan Arnold
Susan Arnold el 29 de Feb. de 2016
Editada: Susan Arnold el 29 de Feb. de 2016
This is the situation I have and I can not modify it. Could you please then suggest an another solution ?
Susan Arnold
Susan Arnold el 29 de Feb. de 2016
I am not sure, but I think bsxfun function can do something in my situation as explained in the following link: http://stackoverflow.com/questions/16973341/efficiently-compute-many-inner-products-in-matlab
Guillaume
Guillaume el 29 de Feb. de 2016
bsxfun may or may not help (probably not). It's impossible to say until we know the end goal.
Why do you want to perform a dot product between these two variables?
Susan Arnold
Susan Arnold el 1 de Mzo. de 2016
The results look like something like above. What should I do then ?!
Guillaume
Guillaume el 2 de Mzo. de 2016
I have no idea what you should do since I have no idea what you're trying to do.
I also have no idea what 'above' refers to. If it refers to the stackoverflow post, in that case both vectors are the same size.

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 29 de Feb. de 2016

Comentada:

el 2 de Mzo. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by