How to define a function with a summation
Mostra commenti meno recenti
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 Commento
Sahil
il 18 Set 2022
syms k x f = matlabFunction(b0 + symsum(a(k)*sin(k*x) + b(k)*cos(k*x)));
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!