Clear Filters
Clear Filters

Error using / Matrix dimensions must agree app designer

4 views (last 30 days)
Hi , i have code, that works perfectly in script , but when i try to run it in app designer i got error. On 1st line i got this :
Matrix dimensions must agree.
and i guess it will be on every line.
app.q1 = real(acosd(app.d4/sqrt(app.AA^2+app.BB^2))+atan2d(app.BB,app.AA)+90);
app.q5 = real(acosd((app.px*sind(app.q1)-app.py*cosd(app.q1)-app.d4)/app.d6));
app.CC = cosd(app.q1)*app.r22-sind(app.q1)*app.r12;
app.DD = sind(app.q1)*app.r11-cosd(app.q1)*app.r21;
app.q6 = real(atan2d(app.CC/sind(app.q5),app.DD/sind(app.q5)));
app.EE = cosd(app.q1)*app.r11+sind(app.q1)*app.r21;
app.FF = cosd(app.q5)*cosd(app.q6);
q234 = real(atan2d(app.r31*app.FF-sind(app.q6)*app.EE,app.FF*app.EE+sind(app.q6)*app.r31));
app.KC = cosd(app.q1)*app.px+sind(app.q1)*app.py-sind(q234)*app.d5+cosd(q234)*sind(app.q5)*app.d6;
app.KS = app.pz-app.d1+cosd(q234)*app.d5+sind(q234)*sind(app.q5)*app.d6;
c3 = (app.KS^2+app.KC^2-app.a2^2-app.a3^2)/(2*app.a2*app.a3);
s3 = sqrt(1-c3^2);
app.q3 = real(atan2d(s3,c3));
app.q2 = real(atan2d(app.KS,app.KC)-atan2d(sind(app.q3)*app.a3,cosd(app.q3)*app.a3+app.a2));
app.q4 = q234-app.q2-app.q3;
app.theta(1,:) = [app.q1 app.q2 app.q3 app.q4 app.q5 app.q6];

Accepted Answer

Voss
Voss on 14 Apr 2024
  5 Comments
Voss
Voss on 14 Apr 2024
Glad you got it fixed.
Since using ./ instead of / fixed the error you asked about, please Accept this answer. Thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!