sym/subs errors
Afficher commentaires plus anciens
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 commentaire
Daniel
le 3 Déc 2020
Réponses (1)
Aniket
le 27 Jan 2025
0 votes
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!
Catégories
En savoir plus sur Operations on Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!