Resacaling an array to align and plot beside another

조회 수: 2 (최근 30일)
Robbie McDermott
Robbie McDermott 2017년 11월 30일
댓글: Robbie McDermott 2017년 11월 30일
I have two arrays that when plotted should align. What is the best way to scale one of these arrays so the largest two maximums are inline? I am trying to show the maximums should all align, the height (intensity) is unimportant right now.
The arrays are both 1 X 600, however I have removed every second element of one of them to make them plot together.
  댓글 수: 2
Jan
Jan 2017년 11월 30일
What kind of arrays do you have? Matrices, vectors, multi-dimensional cell arrays? How is "align" defined? What does "largest two maximum are inline" mean? Why did you remove every 2nd element?
Robbie McDermott
Robbie McDermott 2017년 11월 30일
Hi Jan, sorry, I thought I had attached this image.. Hope that helps answer some of your questions. My two arrays are column vectors. I removed every second value from one as it's original size was 1 X 1200. I thought a simple way to plot them side by side would be just to loss half my data points and then plot.

댓글을 달려면 로그인하십시오.

답변 (1개)

Thorsten
Thorsten 2017년 11월 30일
x = 1:600; A = rand(1, 600);
y = 1:2:600; B = rand(1, 300);
plot(x, A, y, B)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by