Z must be at least a 2x2 matrix
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rendrick Lopes
le 13 Déc 2019
Modifié(e) : Adam Danz
le 16 Déc 2019
x=min(xbm):250:max(xbm);
y=min(ybm):250:max(ybm);
[X,Y]=meshgrid(x,y);
T=scatteredInterpolant(xbm,ybm,ResG,'natural');
plot(xbm,ybm,'ok','MarkerSize',1,'MarkerFaceColor','k');
hold on;
contour(X,Y,T(X,Y),10,'ShowText','on','LineWidth',2);
Error using contour (line 48)
Z must be at least a 2x2 matrix.
why??????
0 commentaires
Réponse acceptée
Adam Danz
le 13 Déc 2019
Modifié(e) : Adam Danz
le 16 Déc 2019
In this line below from your code, T(X,Y) must be at lease a 2x2 matrix and it apparently is not.
contour(X,Y,T(X,Y),10,'ShowText','on','LineWidth',2);
From the documentation,
contour(X,Y,Z) draws a contour plot of Z using vertices from the
mesh defined by X and Y. X and Y can be vectors or matrices.
If you need more help troubleshooting, please provide the values for the missing variables in your question so we can run your code.
4 commentaires
Adam Danz
le 13 Déc 2019
Great! It's always a good idea to look at the values of the variables to make sure they appear as you expect them to.
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!