How to write the given equation in matlab?
3 views (last 30 days)
Show older comments
I already got the h0a k0 r0 and p0 but I ran into issues writing the line of code. For n , 0 ≤ n <length(h0a), and for J, J=length(r0). How can I write this equation in matlab?
2 Comments
Answers (1)
ANKUR KUMAR
on 2 Dec 2017
I have assumed the values of r_0, p_0 and k_0. This is the command, as per your attached picture. I am not able to understand your question completely.
r
_0=[1 2 3 4 5];
p_0=[8 9 5 6 5];
k_0=[10:10:90];
for n=1:length(k_0)
B=0;
for i=1:length(r_0)-1
A=r_0(i)*((p_0(i))^n) ;
B=B+A;
end
h_ob(n)=B+k_0(n)
end
0 Comments
See Also
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!