Scale plots with different steps
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!