Re: Newbie: Subtract a vector from m-n-p array?



In article <fpfo56$6tp$1@xxxxxxxxxxxxxxxxxx>,
"Volker K" <klinkv.NOSPAM@xxxxxxxx> wrote:

Problem: I only have Matlab 7.2 :-(

I wonder that there's
no possibility in MatLab to do these kind of operations:
M(:,:)-V(1)
M(:,:)-V(2)
M(:,:)-V(3)
M(:,:)-V(4)
...
M(:,:)-V(end)

I guess it is a common problem...


All hope is not lost. you can download my genop.m from the FEX and use
it instead of bsxfun. It will be slower, but it will work and no data
will be copied.

<http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId
=10333&objectType=FILE>

(watch out for wrapped URL)


genop(@minus,M,permute(V,[3 2 1]))

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
.



Relevant Pages

  • Re: Multiple functions with same signature
    ... Doug Schwarz ... Make obvious changes to get real email address. ... also a restart of MATLAB didn't work. ...
    (comp.soft-sys.matlab)
  • Re: fprintf
    ... how can i get matlab to print out the a.txt that will have a FIXED ... which is not quite what i want as I have another programe that will ... Doug Schwarz ... Make obvious changes to get real email address. ...
    (comp.soft-sys.matlab)
  • Re: Multiplying all elements in a single matrix
    ... I'm quite new to matlab and I'm having trouble figuring this one out. ... Doug Schwarz ... Make obvious changes to get real email address. ...
    (comp.soft-sys.matlab)
  • Re: Jth hyperplane in Kth direction of arbitrary N
    ... proposed by Doug Schwarz above). ... this function should really be provided in Matlab. ... subs = repmat); ... Make obvious changes to get real email address. ...
    (comp.soft-sys.matlab)
  • Re: doubt on indeterminate forms
    ... I forgot about the other common sci.math question, ... Steve Lord ... with f and g both approaching zero and both ... matlab to investigate the behavior of x^y in the immediate vicinity of the ...
    (comp.soft-sys.matlab)

Loading