How to store the output?
Afficher commentaires plus anciens
How to store the output of the following for loop ?
import java.math.*;
a = BigInteger('12345678');
c = Biginteger('67436255757');
n = BigInteger('10');
for i=1:double(n)
a = my_function(a,c );
end
where
function [a] = my_function(b,c )
import java.math.*;
a = b.add(c) ;
end
Thanking in anticipation.
Réponses (2)
Image Analyst
le 6 Mar 2022
for k = 1 : round(n)
a(k) = my_function(a, c); % Save the output for every iteration of the loop.
end
2 commentaires
Ammy
le 7 Mar 2022
Image Analyst
le 12 Mar 2022
Modifié(e) : Image Analyst
le 12 Mar 2022
What data class is n?
whos n
If n is already an integer, you don't need to round it
for k = 1 : n
a(k) = my_function(a, c); % Save the output for every iteration of the loop.
end
Catégories
En savoir plus sur Call Java from MATLAB 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!