MATLAB: How to get z for different x algebra x = [-2:0.1:2]; z=x.*(1-x).*(2-x).*(4-x)/((6-x)-(1-x).*(x-7)); I am getting error. Please correct my problem. Best Answer x = [-2:0.1:2];z = x.*(1-x).*(2-x)./((6-x).*(x-7));You just forgot a ./Now you should have a vector x = [-2:0.1:2]; z = x.*(1-x).*(2-x)./((6-x).*(x-7)); plot(x,z) Related SolutionsMATLAB: Simplify expression after collect function call vpa() on the expression. MATLAB: Plot for different value of a x = [-2:0.1:2];a = [.5, 1, 1.3, 1.95];figure;for i=1:length(a) z = x.*(a(i)-x.^2); plot(x,z);hold on;end Related QuestionBreak an equation into 2 linesConstraint condition and IF statementThe message “Array indices must be positive integers or logical values.” is displayedFailure in initial objective function evaluation. FMINUNC cannot continue.Implementation of formula in a single line.Solve 12 equations with 12 unknown ERROR: FSOLVE requires all values returned by functions to be of data type double.
Best Answer