フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

could anyone help me to solve the error

2 ビュー (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 1 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Bmax=20;
noise=10;
A= [2 3 0 0 5;
5 6 0 0 4;
1 9 0 0 3]
B = [1 5 0 0 6;
4 3 0 0 2;
7 8 0 0 9]
G=sort(A,'descend')
P=sort(B)
syms k
for k=1:size(G,1)
throughput =(Bmax.*log2(1+(((P).*(G))./(noise+(symsum(P,1:k-1).*G)))))
end
If i am running the code i am getting
Error in (line 16)
throughput =(Bmax.*log2(1+(((V).*(U))./(noise+(symsum(U,1,k-1).*V)))))
Undefined function 'symsum' for input arguments
of type 'double'.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 1 月 16 日
Your error message has symsum of U but your code has symsum of P .
Your array P is the result of the sort(B) and since B is numeric, your P is numeric. You cannot symsum() a numeric array. Even if you could, your syntax symsum(P,1:k-1) would only be a valid syntax if k just happened to be 3, in which case 1:k-1 would be 1:2 and you would accidentally encounter the abbreviated syntax symsum(f,AB) meaning the same as symsum(f, symvar(f), AB(1), AB(2))
Your error message has symsum(U,1,k-1) which would be symsum(U, symvar(U), 1, k-1) which would be valid if U happened to be a symbolic expression. Unfortunately, U is not defined in your code.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by