My plot comes up as a white graph with no line.

3 views (last 30 days)
My homework is like that,
This is about dynamic voltage stability, I can't code this equation. After that I eliminate T, because it is constant, then just calculate PR. I want to draw t,PR and t,VR graph. But i can't. Please help me.
This question says Vr changes 1-0.9-1-1.05-1 respectively. then calculate Pr for T=1 and T<1,T>1.
Thank you from now.
When I try to plot with this code which is given below, nothing comes up. There are no errors, there's just nothing. I know, I only asking to draw one point at a time, so the plot has no information about which points should be connected. But i am new at Matlab, i can't able to draw graphic, please help me.
Expected graphic is like that,
clear all;
clc;
G=3;
t1=1:5
VR1=1;
PR1=G*VR1^2;
t2=5:15
VR2=0.9;
PR2=G*VR2^2;
t3=15:25;
VR3=1;
PR3=G*VR3^2;
t4=25:35;
VR4=1.05;
PR4=G*VR4^2;
t5=35:40;
VR5=1;
PR5=G*VR5^2;
hold on, plot(t1,VR1)
plot(t2,VR2)
plot(t3,VR3)
plot(t4,VR4)
plot(t5,VR5)
xlabel('t(1/100)'); ylabel('VR');
title('PR Değişimi');
grid on

Answers (1)

Image Analyst
Image Analyst on 11 Apr 2021
Give it a line style, like
plot(t, PR1, 'b.-', 'LineWidth', 3, 'MarkerSize', 30);
but the real problem is your PR are just scalars, not vectors, so there is not another point to draw the line between. Your PR do not depend on t, just VR, which is another scalar, so your result is a scalar.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!