How to substract every two adjacent column from a matrix
1 view (last 30 days)
Show older comments
Hi,I new to matlab and i couldn't solve this issued. I have a matrix of [3750,666] and I need to subract every two adjacent column and normalize it. Can somebody help me with this?

0 Comments
Accepted Answer
Matt J
on 12 Feb 2021
y=(x(:,3:N)-x(:,1:N-2))./x(:,2:N-1);
4 Comments
Matt J
on 12 Feb 2021
Edited: Matt J
on 12 Feb 2021
i want to subract every two adjacent column x(:,3:N)-x(:,1:N-2))
Are you asking here for a different computation than the one you originally posted? If not, un-Accept the answer and explain in what way the answer doesn't accomplish what you're after.
More Answers (1)
Matt J
on 12 Feb 2021
Perhaps this is what you were looking for,
y = conv2(x,[1,0,-1],'same')./x;
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!