필터 지우기
필터 지우기

How do I multiply 2 different sized arrays together?

조회 수: 4 (최근 30일)
Jaydeep Dutta
Jaydeep Dutta 2017년 12월 22일
댓글: Roger Stafford 2017년 12월 23일
Currently I have 2 variables stored in an array: one variable(f) contains the frequency which contains about 1000+ points and a variable(wl) that contains only about 10 values
How do I use both variables in a single equation such as Jdz = wl.*thInG.*(Int.*part1.*(part2 - part3))./Eg; where the Int variable depends on the f variable.
Currently, I am facing the Dimension Don't match error.
  댓글 수: 4
Roger Stafford
Roger Stafford 2017년 12월 23일
You haven't yet explained how the 1000+ values in f are to be used to produce only 10 Jdz values. You could separate the f values into ten distinct groups but how would you deal with the hundred or so elements in each group, along with a single value of wl, to produce a single numerical value in Jdz? That is still a question that needs to be answered.
Walter Roberson
Walter Roberson 2017년 12월 23일
Note: User is using MATLAB 6.1

댓글을 달려면 로그인하십시오.

답변 (1개)

Ahmed raafat
Ahmed raafat 2017년 12월 23일
x=rand(4);
y=rand(6);
[x,y]=meshgrid(x,y);
z=x.*y
  댓글 수: 1
Roger Stafford
Roger Stafford 2017년 12월 23일
If this is applied with your original numbers you would get 10*1000 Jdz values, not 10.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by