Creating a matrix with results of while loop
Afficher commentaires plus anciens
Hi i'm new to MATLAB and was wondering how to plot a two column matrix, one column contianing the count number and the other containing the corresponding uk1 value at each count. Any help would be much appreciated.
% 1)Randomise initial U, m
Uk0 = rand( 6 , 1 );
% 2)initialise iteration process
Uk1 = 1;
Uki = Uk0;
% 3)Begin iterative process
count = 0 ;
while abs( Uk1 - Uki ) > 10^-9
count = count + 1 ;
Uk1 = inv(Kd) * ( -Kslsu * Uk0 + f ) ;
Uki = Uk0 ;
Uk0 = Uk1 ;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!