# how do I extract the graph so that the x-axis becomes a frame

1 回表示 (過去 30 日間)
지원 전 2023 年 3 月 16 日

1.present situation Fig.0 Fig.1
Figure 0 is a numeric representation of the bin file. Based on the number of cells, we extracted the graph of Fig.1 by frame (code is below).
For example, suppose it's a 32 frame, we've written code to have 32 pictures like this. in other words, a graph with velocity information is drawn for each frame.
2. what I want Fig.2
Like the graph in Figure 2., I want to show all the velocities of each frame in a single graph.
3. my code
What code should I add to represent the x-axis as a frame (time) as shown in Figure 2?
i = 0; % For recording the number of times
numframe = 32;
for n=1:numframe
%fft_out = fftshift(fft_out);
fft_out = 20*log10(abs(fft_out));
%% 횟수 기록
i = i+1;
%% Obtain range-velocity map after performing 2d fft
% range
c = 3e8; % speed of light
s = 29.9817e15; % slope of chirp signal
Fs = 7675e6;
range = (c*fb)/(2*s);
% velocity
lamda = 5e-3; % Tx signal length
PRT = 310.8e-6; PRF = 1/PRT; % PRF = Pulse Repitition Frequency, PRT = ..Time
velocity = PRF/(numChirps/numframe-1)*(0:(numChirps/numframe-1))*lamda/4*pi;
% plot
figure; % two dimension
imagesc(-velocity, -range ,abs(fft_out));
xlabel('velocity(m/s)');ylabel('range(m)');
% save image
myfilename = sprintf('Going%d.png', i);
saveas(gcf, myfilename)
end

サインインしてコメントする。

### 回答 (1 件)

Varun 2023 年 4 月 19 日
Hello!
As per my understanding, you want to put together all the frames generated in the loop side-by-side in the same figure. Since, you are saving all the plots generated as image files (.png), you can use the imtile function to arrange the plots frame by frame. You can customise the grid size and other parameters to get the figure you need. You may find the documentation for ‘imtile’ at: https://www.mathworks.com/help/matlab/ref/imtile.html#mw_dcf93777-52b2-49db-a80e-c61ad515dd7b
Hope this helps!

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

R2022a

### Community Treasure Hunt

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

Start Hunting!