how do I compare two variables

조회 수: 106 (최근 30일)
민준 배
민준 배 2022년 12월 1일
답변: Nihal Reddy 2023년 2월 13일
i have two variable.
and i need to know how similar and different the two variables are.
which function do i have to use?
  댓글 수: 1
Rik
Rik 2022년 12월 1일
How would you like to quantify different and similar? That part is not a Matlab question, but a question for you.
You should also include some examples of how your variables look. There is no general metric for difference or similarity that works for all data types.

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

답변 (1개)

Nihal Reddy
Nihal Reddy 2023년 2월 13일
I am assuming you want to check whether two variables are equal or not. For that purpose you can use the 'isequal' function which returns logical 1 (true) if A and B are equivalent; otherwise, it returns logical 0 (false). Please refer the following code snippet on how to use it:
A = 0;
B = 0;
tf = isequal(A,B);

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by