How change x axis scale from array values into time?

1 次查看(过去 30 天)
Hai, i have this code, and i woud like make x axis above graph, like x axis of picture bottom. Sin graph is correct in time samples from bottom picture, but i want make signal with zeros, until f.e. 1*10^7 s., then sinusoid. How to change x axis scale from index values into time samples?
code:
clear all; close all; f = 14E6; % Input Signal Frequency T=1/f; fs=1000e6; dt=1/fs; Nper=10; % period tmax=Nper*T; lambda=3e8/f; %bangos ilgis metrais d=lambda/2 %atstumas tarp elementu t = [0:dt:tmax];%sinusinio signalo trukme x1=zeros(1,100); s1 = sin(2*pi*f*t); x1(1,100:814)=s1; figure(1); subplot(2,1,1); %x1 = awgn(x1,20); plot (x1); grid ('on'); subplot(2,1,2); plot(t,s1); grid ('on');
Thank for the tips, and help.

回答(1 个)

Rick Rosson
Rick Rosson 2012-3-26
Please format your code.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by