Define a Matrix 3x3 using matlab
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm tryin to define a 3x3 matrix using matlab but I get an error: Undefined function or variable 'A'. Here's my code:
J := matrix([[-(l1+q2)*sind(q1)-l3*sind(q1+q2), cosd(q1), -l3*sind(q1+q3)], [(l1+q2)*cosd(q1)+l3*cos(q1+q3), sind(q1), l3*cosd(q1+q3)],[1,0,1]]);
Can someone please help with the syntax?
1 comentario
Azzi Abdelmalek
el 20 de Mayo de 2016
There is no any variable A in your expression, := is not a Matlab operator, use instead = operator
Respuestas (1)
Naga
el 24 de Sept. de 2024
Hello Nemo,
It looks like there are a few syntax issues in your MATLAB code. As Azzi mentioned MATLAB does not use := for assignment; instead, it uses =. Additionally, the function to define matrices in MATLAB is simply using square brackets [] without the 'matrix' keyword. Here is
The corrected MATLAB code:
J = [-(l1 + q2) * sind(q1) - l3 * sind(q1 + q2), cosd(q1), -l3 * sind(q1 + q3);
(l1 + q2) * cosd(q1) + l3 * cosd(q1 + q3), sind(q1), l3 * cosd(q1 + q3);
1, 0, 1];
0 comentarios
Ver también
Categorías
Más información sobre Logical 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!