Effacer les filtres
Effacer les filtres

How to reolve this error? Matrix dimensions should agree..!

2 vues (au cours des 30 derniers jours)
Shivam Gupta
Shivam Gupta le 28 Oct 2016
Modifié(e) : James Tursa le 28 Oct 2016
theta=0:0.01:2*pi;
r1=3/cos(theta);//getting error here "Error using / Matrix dimensions must agree"
r2=-4/sin(theta);//getting error here "Error using / Matrix dimensions must agree"
polarplot(theta,r1);hold on;
polarplot(theta,r2);

Réponses (1)

James Tursa
James Tursa le 28 Oct 2016
Modifié(e) : James Tursa le 28 Oct 2016
Use element-wise operator ./ instead of the matrix operator /
r1=3./cos(theta);
r2=-4./sin(theta);

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by