Help needed: empty plot when plotting for loop
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
Below is my code. I am trying to plot all values of the for loop but I am getting an empty plot. What am I doing incorrectly?
for i=2:1:1369
a = (V(i+1)-V(i-1))/(2*(t(i+1)-t(i-1)));
A = ((1/2)*Rhoa*Cd*Af*(V(i).^3));
G = (Mv*g*cos(0).*V(i));
I = (1.1*Mv.*a.*V(i));
Pw = (A+G+I)/1000;
end
figure
hold on
i=2:1:1369;
plot(i,Pw);
grid
xlabel('Time (s)')
ylabel('Power, Pw (KW)')
set(h,'linewidth',2)
댓글 수: 0
채택된 답변
추가 답변 (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!