Scale plots with different steps

4 ビュー (過去 30 日間)
LB
LB 2021 年 5 月 15 日
コメント済み: Mathieu NOE 2021 年 5 月 17 日
Hello,
I have two data sets both achieved with different scales that i would like to plot together (one over another) but haven't been able to (correctly).
In the first dataset i have a 59x59 array in which x from [0->30] represents 1.2cm and [30->59] another 1.2cm (radius of a circle basicly).
In the other i have a 35x35 array in which [0->17] represents 1.28cm and [17->35] another 1.28cm.
How can i scale the two datasets in order to be plotted together?
I tried just creating a new 59x59 array and placing the 35x35 inside it centered but it obviously makes no sense as the widths don't make sense.
The plot i'm trying to do is a simple surf(data1) hold on contour3(data2).
How should i proceed?
Thank you

採用された回答

Mathieu NOE
Mathieu NOE 2021 年 5 月 16 日
hello
my suggestion below
hope it helps
clearvars
load('Data1.mat')
measurements1 = measurements;
x = linspace(-1.2,1.2,size(measurements1,1));
y = x;
figure(1),surf(x,y,measurements1);
hold on
load('Data2.mat')
measurements2 = measurements;
x = linspace(-1.28,1.28,size(measurements2,1));
y = x;
contour3(x,y,measurements2);
  2 件のコメント
LB
LB 2021 年 5 月 16 日
Wow amazing! Thank you so much!
Mathieu NOE
Mathieu NOE 2021 年 5 月 17 日
You're welcome

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by