Borrar filtros
Borrar filtros

Not enough input arguments "Error using Cos"

1 visualización (últimos 30 días)
I am trying to build a matrix A which has the following cos and sin components, However when I try to put them together, I get the error of "Not enough input arguments". When I copied a single line and executed, I got the answer, I don't know why this is not working when I run everything together.
%% Test
phi_r = 0;
phi = pi/2;
alpha = 0.35;
omega = 1;
% Initial step (Matrices)
A = [ 0 ,0 ,0 ,0;...
v_phi .* cos(phi_r) .* cos (phi),-v_phi .* cos(phi_r) .* cos (phi), 1, -v_phi./alpha.* sin(phi_r).*cos(phi);...
v_omega * cos(phi_r) .* cos (phi), -v_omega .* cos(phi_r) .* cos (phi),0,-v_omega/alpha.* sin(phi_r).*cos(phi);
eta.*alpha.*cos(phi_r).*sin(phi),-eta.*alpha.*cos(phi_r).*sin(phi),0,-eta.*sin(phi_r).*sin(phi)];

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Feb. de 2020
No space between cos and (
You are inside a list building operation. Spaces can indicate that an entry has ended and a new one is about to begin. MATLAB does not determine a new entry to start if the previous entry ends in one of the binary operators
3+ 5 %all one expression
3 + 5 %all one expression
3 +5 %two expressions, 3 and +5
cos is not a binary operation, so
3 + cos (x)
is two entries, 3+cos and (x). In turn 3+cos is 3+cos() which is the function invoked with no arguments.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by