Parfor Can not convert cell to double
4 次查看(过去 30 天)
显示 更早的评论
Hello guys.
I have a problem with parfoor loop usage.
I have cell including protein sequences and their ids. I want to consider the sequences only and i need to add sequences to the another cell.
The code below is working
i = 1
while i < length(sampleProtein)
for k=2:2:length(sampleProtein)
X(i,:) = sampleProtein(k)
i = i+1
end
end
Yet, when i use parfor it gives me an error "Conversion to double from cell is not possible"
parfor i=1:length(sampleProtein)
for k=2:2:length(sampleProtein)
X(i,:) = sampleProtein(k)
end
end
Can you guys help me out?
0 个评论
采纳的回答
Walter Roberson
2020-6-22
parfor i=1:length(sampleProtein)
X{i} = sampleProtein{2*i};
end
4 个评论
Walter Roberson
2020-6-22
But probably you should just skip the parfor and do
X = sampleProtein(2:2:end);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!