How to apply at each cell a division

2 次查看(过去 30 天)
Hi, I've a 1500x1500 double cells, I want to apply a division for a number took it from a 4000x1 double cells, and do it in a for cycle.
I wrote a code that open my files from a directory, but I know that I have to use cellfun comand to do that.
Thanks in advance
Stefano
  5 个评论
Stefano Alberti
Stefano Alberti 2016-2-15
I've a 4000 matrix of 1500x1500, and it rappresent a displacement. I've a 1 matrix of 4000x1, and it rappresent the time.
I'd create a matrix with each cells its the resulf ot division of first matrix/first value of second matrix.
e.g.
matrix 1 = 1 2 3
4 5 6
...
matrix 2 = 7
8
9
10
11
12
....
matrios result = 1/7 2/8 3/9
4/10 5/11 6/12
...
Do it in a for cycle for each matrix.
It si possible ?
Thanks
dpb
dpb 2016-2-15
Still, 1500 X 1500 ~= 4000??? (Actually, of course, 1500^2 is much, much larger than 4000.)
As for the element-wise division, for the first N elements of the first it's possible...
M=matrix1.'; % reorient to column major
M4K=M(1:4000); % save first 4K points
matrix2=M4K./matrix2; % do division as illustrated by example
But, still how to treat the 2.246 million other values from the original 2.25M-element 1500-square array would be a mystery.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by