element wise operation column matrix
2 次查看(过去 30 天)
显示 更早的评论
I have a column matrix of data , Temp_data= [20;27;29;33;40] , i want to subtract each element i, by the first element (i.e 20-20; 27-20; 29-20;33-20), how do i do this?
also, how to do the similar operation if i have to subtract consequtive elements, i.e A(n) - A(n-1) [ex: 20-20; 27-20; 29-27....]
0 个评论
回答(2 个)
Stephan
2021-5-25
Temp_data= [20;27;29;33;40]
Case_1 = Temp_data - Temp_data(1)
Case_2 = diff(Temp_data)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!