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

1 visualización (últimos 30 días)
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.

Respuestas (1)

Jan
Jan el 5 de Ag. de 2022
Use another name for your function.

Categorías

Más información sobre General Physics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by