필터 지우기
필터 지우기

Calculate diff between vectors and find Max

조회 수: 10 (최근 30일)
Nasrin Ramezanzadeh
Nasrin Ramezanzadeh 2023년 3월 24일
답변: Swaraj 2023년 4월 4일
Hi Guys,I have three column matrices, I want to calculate their differences one by one and finally get the maximum value. The dimension of the matrix is 1024.Thanks to all
  댓글 수: 2
dpb
dpb 2023년 3월 24일
Unclear problem satement, show us a small example what you want to calculate.
However, the first step is going to be to put the three separate variables into one array (or at least a cell array) so can operate on them by row, column references instead of having to write explicit code or the ugly, error prone ways we won't even mention...
DGM
DGM 2023년 3월 24일
The difference between what and what? If you're looking for the maximum difference, then order matters. ... or are you asking for the absolute difference?

댓글을 달려면 로그인하십시오.

답변 (1개)

Swaraj
Swaraj 2023년 4월 4일
You can use the “diff” function to calculate the differences.
You can than use the “max” function to find the maximum out of the resulting vector.
Documentation of “diff”
Documentation of “max”

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by