Effacer les filtres
Effacer les filtres

Getitng error suggesting that I should "Use rotate(app, ...) to call this function.". How should I format my code?

1 vue (au cours des 30 derniers jours)
Hi,
This is what my code for the function "Rotate" looks like:
The error I get here is: Use app as the first argument for 'rotate'.
function o = rotate(centre, verts, theta)
R = [cosd(theta) -sind(theta) cosd(theta)];
c = centre - vertsl
c = c*R;
o = centre + c;
end
I get an error suggesting that I should "Use rotate(app, ...) to call this function.". How can I fix this? It's not running.
This is what the code looks when I call it under the callback function of the buttton:
% Do the rotation of the circles
verts = rotate(root, verts, theta);
sc1_loc = rotate(root, [root(1) + h, root(2)], theta);
sc2_loc = rotate(root, [root(1) - h, root(2)], theta);
bc1_loc = rotate(root, [root(1), root(2) + k], theta);
bc2_loc = rotate(root, [root(1), root(2) - k], theta);
sc1_loc_straight = rotate(root, [root(1) + h, root(2)], 0);
sc2_loc_straight = rotate(root, [root(1) - h, root(2)], 0);
bc1_loc_straight = rotate(root, [root(1), root(2) + k], 0);
bc2_loc_straight = rotate(root, [root(1), root(2) - k], 0);
I am very new to using Matlab so please excuse any inconveniences caused.
Thanks.

Réponses (1)

Jan
Jan le 5 Août 2022
Use another name for your function.

Catégories

En savoir plus sur General Physics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by