Iterating over a vector to create a cell array without for loop
Show older comments
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 Comment
Abhishek Gupta
on 21 Dec 2020
It would be helpful, if you could share your data containing 'datos'.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!