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!