www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CalculateSeveralRealRootsofScalarExample.m

    %% Calculate Several Real Roots of Scalar  

%% 
% Create a vector of roots to calculate, |N|. 
N = [5 3 -1];  

%% 
% Use |nthroot| to calculate several real roots of |-8|. 
Y = nthroot(-8,N) 

%%
% The result is a vector of the same size as |N|.