Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am trying to eliminate the negative Y-axis (-0.2 portion in the image below). So that the Y-axis of the graph starts from zero. I have attached the .mat file. Please help me out. Here is my code:

5 ビュー (過去 30 日間)
Biswarup  Dutta
Biswarup Dutta 2017 年 3 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
clc
a=importdata('robin roy.mat');
b=a.data;
x=b(22000:25830,1);
plot(x);
x(x<0)=[];
findpeaks(x);
findpeaks(x,'MinPeakHeight',1.15);

回答 (1 件)

Geoff Hayes
Geoff Hayes 2017 年 3 月 14 日
Biswarup - try setting the y-axis limits using ylim as
ylim([0 1.4]);
  2 件のコメント
Biswarup  Dutta
Biswarup Dutta 2017 年 3 月 14 日
Hi Geoff, I have tried that but it does not work. Here is my updated code:
clc
a=importdata('robin roy.mat');
b=a.data;
x=b(22000:25830,1);
plot(x);
ylim([0 1.4]);
x(x<0)=[];
findpeaks(x);
findpeaks(x,'MinPeakHeight',1.15);
Correct me if I have done anything wrong.
Geoff Hayes
Geoff Hayes 2017 年 3 月 14 日
Hmmm...it works fine when I do something like
x = -2*pi:0.01:2*pi;
y = sin(x);
plot(y);
ylim([0 2])
What happens when you try the above example code?

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by