Clear Filters
Clear Filters

How change x axis scale from array values into time?

1 view (last 30 days)
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.

Answers (1)

Rick Rosson
Rick Rosson on 26 Mar 2012
Please format your code.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!