¿Por qué me aparece el tipo de error "Invalid use of operator." al introducir la expresión Z=5*X.^2+5*Y.^2-X.*Y.-11*X+11*Y.+11 para generar gráficas de contorno? Muchas Gracia

답변 (1개)

Arif Hoq
Arif Hoq 2022년 2월 18일
편집: Arif Hoq 2022년 2월 18일

0 개 추천

if you want to perform element-by-element calculations with vectors, you should use a dot (.) before any multiplication (*), division (/), or power (^) operators that involve vectors. but not for addition, subtraction. that's why its showing error.
X=[5,7,8] ; % anyvalue
Y=[7,3,2]; % anyvalue
Z=5*X.^2+5*Y.^2-X.*Y-11*X+11*Y+11
Z = 1×3
368 236 269

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

편집:

2022년 2월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by