matlab does not plot the from origin

1 次查看(过去 30 天)
trying to plot my lab result, but the first data point suppose to be (0,0) , can't make matlab plot that....does this happen to everyone?
function phase_freq(f1,p1,f2,p2,f3,p3,f4,p4,f5,p5,f6,p6,f7,p7,f8,p8,f9,p9,f10,p10)
f(1)=f1;
f(2)=f2;
f(3)=f3;
f(4)=f4;
f(5)=f5;
f(6)=f6;
f(7)=f7;
f(8)=f8;
f(9)=f9;
f(10)=f10;
p(1)=p1;
p(2)=p2;
p(3)=p3;
p(4)=p4;
p(5)=p5;
p(6)=p6;
p(7)=p7;
p(8)=p8;
p(9)=p9;
p(10)=p10;
for i = 1:10
phase(i) = (p(i)/f(i))*360;
end
F = [0 3.3 3.76 7.56 11.40 15.29 19.23 23.21 27.24 31.32];
plot(F,phase,'-.r*')
xlim([0 32]);
xticks(F);
%xticklabels({'0','3.3', '3.76' '7.56', '11.40', '15.29', '19.23', '23.21', '27.24', '31.32'});
xlabel('frequency difference in khz')
ylabel('steady state phase difference')
title('constant coupling')
  2 个评论
Ameer Hamza
Ameer Hamza 2020-4-6
Is f(1)==0? In that case, phase(1)=p(1)/f(1) will become inf. If you want to start from origin, then you need to provide a finite value for phase(1).

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by