Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

could anyone help me to solve the error

1 visualización (últimos 30 días)
Prabha Kumaresan
Prabha Kumaresan el 16 de En. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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'.

Respuestas (1)

Walter Roberson
Walter Roberson el 16 de En. de 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.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by