How to define a function with a summation
16 views (last 30 days)
Show older comments
Hello,
I'm fairly new to matlab so I'm not too familiar with the way all of the functions work. I need to plot a function I have been given :
but I am having trouble defining it. I've tried the following:
syms k x
f = matlabFunction(b0 + symsum(a(k)*sin(k*x) + b(k)*cos(k*x)));
This gives me an error stating "Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression."
Can someone help me out? :)
1 Comment
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical 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!