Iterating over a vector to create a cell array without for loop
Mostra commenti meno recenti
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 Commento
Abhishek Gupta
il 21 Dic 2020
It would be helpful, if you could share your data containing 'datos'.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!