MATLAB: How to sum specific value in 1:m how to sum specific value in 1:m m=1:2 b(m)=sum(sin(1:m)*b) then the result b(1)=sin(b) b(2)=sin(b)+sin(2*b) But I need b(1)=sin(b) b(2)=sin(b)+sin(3*b) for n b(n)=sin(b)+sin(3*b)+sin(5*b)+sin(7*b)… Best Answer for m=1:nf(m)=2*m-1b(m)=sum(sin(f)*b)end Related SolutionsMATLAB: Error when plotting function Did you read the documentation ?a1=...;a2=...;a3=...;a4=...;b1=...;b2=...;b3=...;b4=...;c1=...;c2=...;c3=...;c4=...;fplot(@(x)(a1*sin(b1*x+c1) + a2*sin(b2*x+c2) + a3*sin(b3*x+c3) + a4*sin(b4*x+c4),[0,4000]) MATLAB: Matrix differentiation syms a b c tM=[cos(a)*sin(b)*cos(c) sin(a)*sin(b)*sin(c) cos(a)^2*sin(b)^2*cos(c)];k = regexprep(char(M),{'\(a\)','\(b\)','\(c\)'},{'\(a\(t\)\)', '\(b\(t\)\)', '\(c\(t\)\)'});out = feval(symengine,'diff', k, t)ADD after rami's commentz = feval(symengine,'diff', k, t);out = sym(regexprep(char(z),'(\(t\))|(\*diff\([abc]\(t\), t\))','')) Related QuestionPlot in Bisection MethodWhy below code takes longer time to execute, even with only one input image it takes longer time to execute.Graphing multiple unique points in a lineSymbolic solution to a system of algebraic equationsOptimize a 2 variable function
Best Answer