matrix multiply even and odd by different value
Show older comments
Hi, given a matrix zj
NL=4;NV=6;xiz=0.011e-3;f=1;
zj=repmat((1:NL),NV,1)
Let i be the rows and j be the column elements. So I would like to multiply each element of zj by the following condition
j*xiz % when i is odd
a.*((-1)+2.*j)+(-1).*((-1)+f+j).*(2.*a+xiz) % when i is even
For clarification I've attached an image of this in maths form. Thanks,
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!