필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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.

답변 (1개)

Jan
Jan 2022년 8월 5일
Use another name for your function.

카테고리

Help CenterFile Exchange에서 General Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by