MATLAB: How can I solve difference equation with initial condition. difference equationfilterMATLAB Consider a difference equation with its initial conditions. 5y(n)+y(n-1)-3y(n-2) = (1/5^n)u(n), n>=0 y(n-1) = 2, y(n-2) = 0 How can I determine y(n) in matlab? Best Answer See the FILTER command Related SolutionsMATLAB: Filling vector with a condition. Hi Javier,as far as I understood your question you want to create a new vector with for i=1:lenght(A) if A(i)>0 C(i) = B(i) end endThis could be done in with the for loop above, but the fastest way should be via logical indexing. C = zeros(size(A)); flag_a = A >0 % is logical 1 where elements are bigger zero C(flag_a) = B(flag_a);best, Stephan MATLAB: Scatter3 not plotting after providing condition. Use the hold function. figurescatter3(x(w1), y(w1), z(w1), 'y', 'filled')hold onscatter3( ...)scatter3( ...)scatter3( ...)scatter3( ...)hold off. Related QuestionNeed help with difference equationConverting matrix entries satisfying a threshold condition.
Best Answer