Borrar filtros
Borrar filtros

chi2pdf WITHOUT using a for loop

1 visualización (últimos 30 días)
Anna Kasdan
Anna Kasdan el 16 de Sept. de 2018
Respondida: Naman Chaturvedi el 19 de Sept. de 2018
Hi! I have two arrays (one generated by chi2pdf function) that I need to multiply together without using a for loop, for some values of x:
n=[1 5]; x = [0:0.4:5] chi2pdf(x,n);
is there a way to simply multiply these together in one or two lines of code? Thanks!

Respuestas (1)

Naman Chaturvedi
Naman Chaturvedi el 19 de Sept. de 2018
Element wise multiplication can be performed using the '.*' operator. So, if you have two matrices say X (n x m) and y(n x m) and you want to perform element wise multiplication, you can do so by:-
>> Z=X.*Y;

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by