필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Multiply numeric array with variable array

조회 수: 2 (최근 30일)
Mohamed Musni
Mohamed Musni 2018년 1월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
This is the code so far i have written and i get error message as below. i know that there is something wrong with variable array. how can i do this operation?
qi=sym('qi',[1 3]);
prompt = 'enter which point in time you want to find inventory level';
j = input(prompt)
prompt = 'enter how many basic delivery cycles inventory of item should delivered to retailer i';
fri = input(prompt)
p = j
L = bsxfun(@rdivide,j(:),fri)
R = mod(L,1)
Xij = R <= 0
B = Xij.*qi
and my output is,
>> optimize_vendor
Dr =
[ 1, 2, 3]
M =
6
enter which point in time you want to find inventory level [0:6]
j =
0 1 2 3 4 5 6
enter how many basic delivery cycles inventory of item should delivered to retailer i [1 2 3]
fri =
1 2 3
p =
0 1 2 3 4 5 6
L =
0 0 0
1.0000 0.5000 0.3333
2.0000 1.0000 0.6667
3.0000 1.5000 1.0000
4.0000 2.0000 1.3333
5.0000 2.5000 1.6667
6.0000 3.0000 2.0000
R =
0 0 0
0 0.5000 0.3333
0 0 0.6667
0 0.5000 0
0 0 0.3333
0 0.5000 0.6667
0 0 0
Xij =
7×3 logical array
1 1 1
1 0 0
1 1 0
1 0 1
1 1 0
1 0 0
1 1 1
Error using symengine
Array sizes must match.
Error in sym/privBinaryOp (line 973)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in .* (line 294)
X = privBinaryOp(A, B, 'symobj::zip', '_mult');
Error in optimize_vendor (line 24)
B = Xij.*qi
My requirement is multiply Xij first column with q1, second column with q2 and third column with q3. but the way i define qi array is not so correct. any help is highly appreciated. Thank you
  댓글 수: 3
Mohamed Musni
Mohamed Musni 2018년 1월 23일
sure i will follow your instructions in future. is there any solution for my problem?
Karan Gill
Karan Gill 2018년 1월 23일
Did you read the error message? Was it helpful?

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by