Syntax error in matlab?! Help Please?
Ältere Kommentare anzeigen
A part of my code is below. I am plotting a direction field of a differential equation. The second line of code S=-(X.^2 + Y^2)./(X*Y); and it is telling me that "Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
Error in Practice640 (line 6)
S=-(X.^2 + Y^2)./(X*Y); "
Could anyone help me in how to type it in so it correctly reads it?
[X,Y]=meshgrid(-5:0.1:5, -4:0.1:4);
S=-(X.^2 + Y^2)./(X*Y);
L=sqrt(1+S.^2);
figure
hold on
quiver(X, Y, 1./L, S./L,0.4,'.')
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!