Vector with symbolic variable
I have created a 8×1 sym (vector?) called psi and a 1×1000 double (vector?) called time. When I try to plug in a value from the double into the psi I use the syntax:
psi_eval = psi(time(2));
since this is the way I would have done it in python, however it does not work. I get an error saying:
Array indices must be positive integers or logical values.
Error in sym/subsref (line 909)
R_tilde = builtin(‘subsref’,L_tilde,Idx);
Error in BachelorThesis (line 65)
psi_eval = psi(time(2));
The array index I have given is a positive value so I don’t understand the error I get. What am I doing wrong?I have created a 8×1 sym (vector?) called psi and a 1×1000 double (vector?) called time. When I try to plug in a value from the double into the psi I use the syntax:
psi_eval = psi(time(2));
since this is the way I would have done it in python, however it does not work. I get an error saying:
Array indices must be positive integers or logical values.
Error in sym/subsref (line 909)
R_tilde = builtin(‘subsref’,L_tilde,Idx);
Error in BachelorThesis (line 65)
psi_eval = psi(time(2));
The array index I have given is a positive value so I don’t understand the error I get. What am I doing wrong? I have created a 8×1 sym (vector?) called psi and a 1×1000 double (vector?) called time. When I try to plug in a value from the double into the psi I use the syntax:
psi_eval = psi(time(2));
since this is the way I would have done it in python, however it does not work. I get an error saying:
Array indices must be positive integers or logical values.
Error in sym/subsref (line 909)
R_tilde = builtin(‘subsref’,L_tilde,Idx);
Error in BachelorThesis (line 65)
psi_eval = psi(time(2));
The array index I have given is a positive value so I don’t understand the error I get. What am I doing wrong? symbolic, vector MATLAB Answers — New Questions