I want to construct three tests.
조회 수: 2 (최근 30일)
이전 댓글 표시
If I have four columns, x1, x2, x3 and x4 I want to create the following three tests for the first values of all the four columns
x1=first_value_of column
x1>first_value_of_column
x1<first_value_of_column
Is there an easy way to do this? Please explain in simple terms. I am new to matlab
댓글 수: 0
채택된 답변
Jordan Ross
2016년 9월 21일
Hi Kunal,
As I understand, you are trying to compare a scalar value with a column vector. Consider the following example where "t" is a row vector from 1 to 10:
>> t = 1:10; % create row-vector from 1 to 10
>> t = t'; % transpose t so it is now a column vector.
>> t(1) < t;
>> t(1) == t;
In this code I am comparing the first element of "t" with the entire column vector.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!