Search code examples
matlabif-statementquadratic

Matlab - Using IFELSE statement to solve quadratic formula


enter image description here

I need help getting this script started. Your help will be greatly appreciated! Again, I don't want the answer but rather how to start this script so it can spark ideas. Thank you once again!


Solution

  • if a == 0
        if b == 0
            if c == 0
                % Case 1)
            else
                % Case 2)
            end
        elseif c ~= 0
            % Case 3)
        end
    
        % Case 5: a==0, b~=0, c==0
        % Linear equation through origin
    
    else
        % Case 4)
    end