Mesh Data: Interpolating data and swapping axes
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Philip So
am 21 Sep. 2018
Beantwortet: Philip So
am 24 Sep. 2018
Hi
I have a surface plot and would like to swap the axes.
Suppose I have data like this
A = [0 1 2 3 4]; %x-axis
B = [10 11 12]; %y-axis
C = [0 5 3 8 5; 3 4 5 3 1; 6 4 9 2 1]; %z-axis
With surf(A,B,C), I can get a surface plot like this

But now I want to swap the axes for the data, so it would look like this
A = [0 1 2 3 4]; %x-axis (same)
C = [0 1 2 3 4 5 6 7 8 9 10]; %y-axis (new)
B = [??]; %z-axis (new)
How can I compute the new matrix B? I believe I will need to interpolate the data.
1 Kommentar
dpb
am 22 Sep. 2018
"I will need to interpolate the data."
Not interpolate but extrap-olate grossly outside the range of any data. This would be risky at best...
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 22 Sep. 2018
You cannot do that. Look in your original C data and see that there are three different locations at which C is 5. It is not possible to pick just one of them as being "the" correct place for 5 to occur.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

