How can I make an array with a function that defines every element?
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
I would like to make an array theta_i=(theta_1, theta_2, .., theta_n) such that I can define a function theta_j=1/j for all j. So the result would be: theta_i=(1, 1/2, 1/3, ..., 1/n) for some n.
Risposte (2)
Pritesh Shah
il 5 Ott 2016
0 voti
for i=1:lenth(theta_i)
y(i)=1/i;
end
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!