How change x axis scale from array values into time?
古いコメントを表示
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
2012 年 3 月 26 日
0 投票
Please format your code.
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!