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?
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!