how can I do calculations using an array as a result and dividing each element of an array for an expression
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I would like to know how can I do calculations using an array as a result and dividing each element of an array for an expression I am using the following code:
n=10
for j=drange(1:n)
P(j)=-w(j)/(y*(4*y^2-3*u^2)*(7*r*z))
end
All the variable values are previously defined
However, the following error occurs:
Error using / Matrix dimensions must agree.
Error in matlab (line 42) for j=drange(1:n)
Can anyone help me?
regards,
Hugo
2 个评论
Star Strider
2014-12-4
Hugo’s ‘Answer’ moved here ...
Hi, Thanks for the reply
P(j) and w(j) are 10 y u r and z are scalars (size 1)
回答(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!