Iterating over a vector to create a cell array without for loop
Afficher commentaires plus anciens
I would like to know if it is possible to do the same as the code below without a for loop:
for i=1:length(index)
date1{i}=datenum(datos.Date(index(i):end));
Y{i}=(datos.High(index(i):end)+datos.Low(index(i):end))./2;
X{i}=[ones(length(Y{i}),1) date1{i}];
b{i}=regress(Y{i},X{i});
tendency{i}=b{i}(1)+b{i}(2)*X{i}(:,2);
parallel{i}=std(Y{i});
end
1 commentaire
Abhishek Gupta
le 21 Déc 2020
It would be helpful, if you could share your data containing 'datos'.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 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!