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 Comments

David Hill
David Hill on 8 Mar 2022
Edited: David Hill on 8 Mar 2022
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.
Please provide some sample data and the wanted output.
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.
You did not mention, what you want as output.

Sign in to comment.

 Accepted Answer

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

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!