Plotting issue where the curve is missing
조회 수: 1 (최근 30일)
이전 댓글 표시
w=linspace(-5,-0.01)
s=100;
for i=1:s
F = (exp(-1.863*10^-2)+w(i).^(-2)*exp(-1.9*10^-4)-2*w(i).^(-1)*exp(-9.41*10^-3));
O=4*pi*F
end
plot(w,O)
댓글 수: 0
채택된 답변
KSSV
2022년 6월 15일
편집: KSSV
2022년 6월 15일
w=linspace(-5,-0.01) ;
s=100;
O = zeros(size(w)) ;
for i=1:s
F = (exp(-1.863*10^-2)+w(i).^(-2)*exp(-1.9*10^-4)-2*w(i).^(-1)*exp(-9.41*10^-3));
O(i)=4*pi*F ; %<-- save O into an array
end
plot(w,O)
Also note that, you need not to use loop.
w=linspace(-5,-0.01) ;
F = (exp(-1.863*10^-2)+w.^(-2)*exp(-1.9*10^-4)-2*w.^(-1)*exp(-9.41*10^-3));
O=4*pi*F ;
plot(w,O)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!