Filter löschen
Filter löschen

How change x axis scale from array values into time?

1 Ansicht (letzte 30 Tage)
Ramas
Ramas am 26 Mär. 2012
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.

Antworten (1)

Rick Rosson
Rick Rosson am 26 Mär. 2012
Please format your code.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by