Hello,
I have two cell array made of different lengths vectors. Also the arrays have different layouts: 3x3 cells vs. 3x1 cells.
How can I divide them and retain the min vector length to the elements of the newly created array?
I have already tried C=A.\B and seems to be a problem with the cell type of the arrays.
Many thanks.

4 件のコメント

David Hill
David Hill 2022 年 3 月 8 日
編集済み: David Hill 2022 年 3 月 8 日
Do not understand you. It is not hard to find the array having minimum length within the cell arrays. But I have no idea what this sentence means: How can I divide them and retain the min vector length to the elements of the newly created array.
Jan
Jan 2022 年 3 月 8 日
Please provide some sample data and the wanted output.
Catalin Dinu
Catalin Dinu 2022 年 3 月 9 日
Hello,
I'm using two different lengths of vectors 4k and 6k for making up the two arrays. I am looking to have a new array made up of the vectors resulted from the division operation with the first 4k elements. I hope it makes more sense now.
Jan
Jan 2022 年 3 月 9 日
You did not mention, what you want as output.

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

 採用された回答

David Hill
David Hill 2022 年 3 月 9 日

2 投票

Lots of assumptions below, but you should be able to adopt the below code for what you want to do.
[r,c]=size(A);
for R=1:r
for C=1:c
B{R,C}=A{R,C}(1:4000)./F{R}(1:4000);%I assume you want to divide across the entire row
end
end

1 件のコメント

Catalin Dinu
Catalin Dinu 2022 年 3 月 10 日
Thank you very much, David! It worked.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by