Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

could anyone help me to solve the error

2 Ansichten (letzte 30 Tage)
Prabha Kumaresan
Prabha Kumaresan am 16 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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'.

Antworten (1)

Walter Roberson
Walter Roberson am 16 Jan. 2018
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.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by