How do you multiply one single constant value with a 1D array/matrix containing 25 values in Simulink?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
James Murray
el 1 de Abr. de 2014
Comentada: James Murray
el 1 de Abr. de 2014
Hi
I am using a constant block which contains an array of 25 elements in the form [0,1,2,3,......]. I also have another signal that contains a single value e.g. 5. I would like to multiply 5 with each of the elements in that array represented by a constant.
When I try to use the simulink product block I get an error saying "Error in port widths or dimensions. Invalid dimension has been specified for input port 1 of 'Combined/Product1'."
How do I get over this error?
Thanks
0 comentarios
Respuesta aceptada
Mischa Kim
el 1 de Abr. de 2014
Editada: Mischa Kim
el 1 de Abr. de 2014
James, simply use a Gain block (Commonly Used Blocks) and choose Element-wise multiplication (double-click to open the block). The same should work also with the Product block.
4 comentarios
Mischa Kim
el 1 de Abr. de 2014
in1 would be the step signal. The constant is a vector with 25 elements.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/178310/image.png)
Más respuestas (1)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!