chi2pdf WITHOUT using a for loop

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!

답변 (1개)

Naman Chaturvedi
Naman Chaturvedi 2018년 9월 19일

0 개 추천

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;

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2018년 9월 16일

답변:

2018년 9월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by