Scale plots with different steps

4 visualizzazioni (ultimi 30 giorni)
LB
LB il 15 Mag 2021
Commentato: Mathieu NOE il 17 Mag 2021
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

Risposta accettata

Mathieu NOE
Mathieu NOE il 16 Mag 2021
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 Commenti
LB
LB il 16 Mag 2021
Wow amazing! Thank you so much!
Mathieu NOE
Mathieu NOE il 17 Mag 2021
You're welcome

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by