2D Matrix calculation

Hi there,
Fairly new to neuron.
If A is a 1000x1 vector containing non-integer values,
B is a 1000x1 vector also containing non-integer values,
and x is a vector containing integers from 1-36
How would I best go about calculating the following 1000x36 matrix,C:
C(A,B,x) = A/x + B/x
Fyi A and B are changing in time, and values of x are points in space (along an x-axis). So im wanting to see how the values at each point in space are changing over time, with 1000 time samples.
So maybe it should be written like this instead:
C(t,x) = A(t)/x + B(t)/x
Many thanks

Respuestas (1)

Star Strider
Star Strider el 29 de Jun. de 2018

0 votos

I would use bsxfun.
These produce the same result:
C1 = bsxfun(@mrdivide, A, x) + bsxfun(@mrdivide, B, x);
C2 = bsxfun(@rdivide, A, x) + bsxfun(@rdivide, B, x);

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Jun. de 2018

Respondida:

el 29 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by