필터 지우기
필터 지우기

Invalid indexing or function definition of curl function

조회 수: 1 (최근 30일)
ali altaif
ali altaif 2022년 11월 15일
댓글: Rik 2022년 11월 15일
The code used to work before but now is showing invalid indexing or function difinition
%<curl> <divergence> <gradient>
syms q w e r t y u i o p l k j h g f d s a z x c v b n m
fprintf('\n <curl> <divergence> <gradient>')
fprintf('\n *********************************')
fprintf('\n vector field -> 1 Scalor-> 0')
V=[x y z];
Q0= input("\n do you want to operate on a vector field or a Scalor : ");
if Q0==1
Vector1x = input ('\n input the X component of your vector : ');
Vector1y = input ('\n input the y component of your vector : ');
Vector1z = input ('\n input the z component of your vector : ');
v1=[Vector1x,Vector1y,Vector1z];
fprintf('Divergence -> 1 curl-> 0')
Q1=input("\n do you want to compute curl or divergence : ");
if Q1==1
V=[x y z];
Vd=[Vector1x,Vector1y,Vector1z];
div=divergence(Vd,V)
else
V=[x y z];
Vc=[Vector1x,Vector1y,Vector1z];
Curl=curl(Vc,V)
end
else
scaler = input( "\n write your scalor function\ : " );
fun=scaler
grad=gradient(fun,V)
end
Erorrs
Error using sym/subsindex
Invalid indexing or function definition. Indexing must follow
MATLAB indexing. Function arguments must be symbolic variables,
and function body must be sym expression.
Error in indexing (line 1079)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in CDG (line 24)
Curl=curl(Vc,V)
  댓글 수: 1
Rik
Rik 2022년 11월 15일
Please format your code as code. That will allow you to run it within this forum. When you attempt to run it, you will notice that you have several manual inputs, which you did not describe. Please supply example inputs that you expect to work.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by