Not enough input arguments "Error using Cos"
1 回表示 (過去 30 日間)
古いコメントを表示
Praveen Kumar Pakkirisamy
2020 年 2 月 12 日
コメント済み: Praveen Kumar Pakkirisamy
2020 年 2 月 12 日
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)];
0 件のコメント
採用された回答
Walter Roberson
2020 年 2 月 12 日
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Multidimensional Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!