getting this error- "Array indices must be positive integers or logical values"
Show older comments
x = 1:101;
a = 0.1088667334;
Aj= -2.669*10^-4
Bj= 0.73409551
w = Aj((cosh(a*x)-cos(a*x))-(Bj(sinh(a*x)-sin(a*x))))
I am getting this error- "Array indices must be positive integers or logical values"
Is there any solution for this ??
2 Comments
Dave
on 27 Mar 2021
I'm not an expert, but looks like you are trying to index into Aj and Bj with calculated values that are not integers. Both Aj and Bj have just one value assigned to them. What exactly are you trying to assign to the variable w?
Ahmad Junaid Naeem
on 27 Mar 2021
Answers (1)
DGM
on 27 Mar 2021
Do you mean to be multiplying these as factors? I can only guess.
x = 1:101;
a = 0.1088667334;
Aj= -2.669*10^-4;
Bj= 0.73409551;
w = Aj*((cosh(a*x)-cos(a*x))-(Bj*(sinh(a*x)-sin(a*x))));
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!