sym/subs errors
Mostrar comentarios más antiguos
v=[];
global a
global N
global k
fplot=fopen('saida_plot','w+');
r=find(diff(subs(diff(1/(((1-a)*(log(N)/log(k)+1))+(a)*(k)),k), {N,k,a},{600,1:1:100,0.1})>=0));
for alpha=0.1:0.1:1
r=find(diff(subs(diff(1/(((1-a)*(log(N)/log(k)+1))+(a)*(k)),k), {N,k,a},{600,1:1:100,alpha})>=0));
if (isempty(r))
alpha;
v=[v,1];
fprintf(fplot,'%d',[v,1])
else
v=[v,max(r)];
fprintf(fplot,'%d',[v,max(r)])
end
end
1 comentario
Daniel
el 3 de Dic. de 2020
Respuestas (1)
Aniket
el 27 de En. de 2025
0 votos
As mentioned in error output, the issue is because of "Division by zero". The expression
will cause a division by zero error if 'k' is 1, because log(1) is 0.
To ensure 'k' never takes a value of 1, range of 'k' can be changed from 1:1:100 to 2:1:100.
I hope this helps resolve the issue!
Categorías
Más información sobre Operations on Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!