getting this error- "Array indices must be positive integers or logical values"
显示 更早的评论
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 个评论
Dave
2021-3-27
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
2021-3-27
回答(1 个)
DGM
2021-3-27
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))));
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!