trying to plot the graph but getting dots pls help me
1 次查看(过去 30 天)
显示 更早的评论
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
采纳的回答
Ameer Hamza
2020-6-6
编辑:Ameer Hamza
2020-6-6
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!