B=1 and LL=1 and n=1
trying to plot the graph but getting dots pls help me
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
SARVESH R
le 6 Juin 2020
Modifié(e) : Ameer Hamza
le 6 Juin 2020
for(n=1:0.25:2)
disp(['n =',num2str(n)])
for(s=0.5:0.5:10)
y=1+(n*(0.5513*log(((2*s)+(3*LL))/((2*s)+LL))))/(2*(0.5513*log(LL/B)+0.8235));
plot(s,y,'r*')
hold on
disp([num2str(s),' = ',num2str(y)])
end
end
Réponse acceptée
Ameer Hamza
le 6 Juin 2020
Modifié(e) : Ameer Hamza
le 6 Juin 2020
Try this
B=1;
LL=1;
n=1:0.25:2;
s=0.5:0.5:10;
for i = 1:numel(n)
for j = 1:numel(s)
y(i,j)=1+(n(i)*(0.5513*log(((2*s(j))+(3*LL))/((2*s(j))+LL))))/(2*(0.5513*log(LL/B)+0.8235));
end
end
plot(s, y, 'r*-')
Following is an alternative version without for-loop
B=1;
LL=1;
n=1:0.25:2;
s=(0.5:0.5:10).';
y=1+(n.*(0.5513.*log(((2.*s)+(3.*LL))./((2.*s)+LL))))./(2*(0.5513*log(LL/B)+0.8235));
plot(s, y, 'r*-')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!