Index in position 1 is invalid. Array indices must be positive integers or logical values ERROR

2 ビュー (過去 30 日間)
hello ,
I try to create a matrix in which every element must have the same column sum of another matrix.
Specifically , i have this matrix :
0.9748 1
0.9748 1
0.5416 0.2996
and i want to create that matrix
0.9748+0.9748+0.5416 1+1+0.2996
0.9748+0.9748+0.5416 1+1+0.2996
0.9748+0.9748+0.5416 1+1+0.2996
i use this command :
second_term_denominator_2(j,i)=second_term_denominator_1(sum(second_term_denominator_1,i),i)
and it gives this error :
Index in position 1 is invalid. Array indices must
be positive integers or logical values.
Error in UNIFAC (line 67)
second_term_denominator_2(j,i)=second_term_denominator_1(sum(second_term_denominator_1,i),i)
I have attached the full folder of the code. I would be very gratefull if anyone could help me

採用された回答

s mohammad hosien abedy nejad
s mohammad hosien abedy nejad 2020 年 9 月 2 日
hello.
you can use iteration like this
a =[ 0.9748 1;
0.9748 1;
0.5416 0.2996]
[x , y] = size(a);
for(i = 1:x)
for(j = 1:y)
second_term_denominator_2(i,j) = sum(a(:,j));
end
end
  2 件のコメント
chntua chntua
chntua chntua 2020 年 9 月 2 日
it still gives errors if you please check my code
chntua chntua
chntua chntua 2020 年 9 月 2 日
ohhhh sorry i was wrong !!!! thank you so much !!!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by