Data dimensions must agree. Using surf

9 次查看(过去 30 天)
I want to make a 3D plot using MATLAB with the code below:
[pA, T] = meshgrid(7600000:100000:20000000, 313:1:373);
mu = ((((-0.1146067)+(0.000000697838).*(pA/100000)+(0.0000000003976765).*((pA/100000).^2)+(0.0633612).*log(T)+(-0.01166119).*(log(T).^2)+(0.0007142596).*(log(T).^3))/(1+(0.000006519333).*(pA/100000)+(-0.3567559).*log(T)+(0.03180473).*(log(T).^2)))/1000);
surf(pA, T, mu);
colormap(jet); % change color map
shading flat % interpolate colors across lines and faces
colorbar;
pA and T are 61x125 matrices and mu is 61x61. Is there a possibility to equalize this so that I can make the surface plot? Or is there another way to make a 3D plot with these matrices?

采纳的回答

Walter Roberson
Walter Roberson 2022-8-9
[pA, T] = meshgrid(7600000:100000:20000000, 313:1:373);
mu = ((((-0.1146067)+(0.000000697838).*(pA/100000)+(0.0000000003976765).*((pA/100000).^2)+(0.0633612).*log(T)+(-0.01166119).*(log(T).^2)+(0.0007142596).*(log(T).^3)) ./ (1+(0.000006519333).*(pA/100000)+(-0.3567559).*log(T)+(0.03180473).*(log(T).^2)))/1000);
surf(pA, T, mu);
colormap(jet); % change color map
shading flat % interpolate colors across lines and faces
colorbar;
You accidentally used / where you needed ./

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by