Data dimensions must agree. Using surf
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Olaf Schipper
am 9 Aug. 2022
Kommentiert: Olaf Schipper
am 9 Aug. 2022
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 9 Aug. 2022
[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 ./
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
