Values on a curve

1 次查看(过去 30 天)
Robert Wu
Robert Wu 2017-1-25
I have a long and flexible probe that is 19m in length. It collects a temperature readings every 0.50m and is stored in a vector (39 values). The probe is bent into a helix with a diameter of 0.70m and a depth of about 0.82m. I want to plot this helix in 2d (so a sine wave basically) with the associated temperature readings as the third dimension.
I then want to interpolate the area around the sine wave (so a 0.70m by 0.82m area) and create a colorplot with this interpolation. How should I start this? I'm pretty new to Matlab and I do not know how to associate a curve with values as a third dimension.

回答(1 个)

staticrain87
staticrain87 2017-1-26
编辑:staticrain87 2017-1-26
I don't think that I am totally able to understand the crust of your question at this momenent. But what I can share quickly with you is how to do a contour plot z = f(x, y) in general
Let's say you have a vector x, y and z and x = [x1, x2.... xn]; y = [y1, y2, .... yn]; z=[z1, z2, .... zn]
%Now convert them into rectangular matrices using meshgrid, and grid data
xi=linspace(min(x),max(x), n); yi=linspace(min(y),max(y),n);
[XI YI]=meshgrid(xi,yi);
ZI = griddata(x,y,z,XI,YI);
contourf(XI,YI,ZI) %Finally do the contour plot
Hope it helps!

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by