Cell Array Conversion to a Numeric Array by using a loop

2 ビュー (過去 30 日間)
Tianchu Lu
Tianchu Lu 2022 年 9 月 12 日
編集済み: Tianchu Lu 2022 年 9 月 12 日
I have a cell array containing over 9000 data, but I want to convert the cell array into double to which I am able to maunipulate data in such a way. Whereby the data is currently stored in cells and I want to find the movemean of 3,4,5 point respectively. Is there such a way that I can loop with a for loop so that after it has done the movmean(TEC{1,1},3) it would automatically do the movmean(TEC{1,2},3) and so on and so forth?
TEC_mean_1=movmean(TECs{1,1},3);
TEC_mean_2=movmean(TECs{1,1},4);
TEC_mean_3=movmean(TECs{1,1},5);
delta_TEC_1=TECs{1,1}-TEC_mean_1;
delta_TEC_2=TECs{1,1}-TEC_mean_2;
delta_TEC_3=TECs{1,1}-TEC_mean_3;
Many Thanks
Edited Version %%%%%%%%
This picture shows the cell and the row is a double array containing several hundred of data. I was hoping to to extract each row within this cell array and convert it into a single column double array, and finding the movmean of the double as shown in the cell array and then extracting the processed data and making it a new variable if possible( or any or mean method of data storage)

採用された回答

dpb
dpb 2022 年 9 月 12 日
You can try
m=cellfun(@(x)movmean(x,3),TECs,'UniformOutput',0);
If the content of TECs is an array of double arrays, you'll get a new cell array of the moving mean by column of each of those arrays with the default behavior of movmean regarding end effects.
This is almost a pure quess from limited information on how the cell array is actually constructed; see <how-to-ask-a-question-on-answers-and-get-a-fast-answer> for pointers.
  1 件のコメント
Tianchu Lu
Tianchu Lu 2022 年 9 月 12 日
hi, thanks for your answer, I have put limited infortmation on this matter, I appreciated your answer, I will try and edit the question so that you are able to see what I am trying to ask.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by