comparison of two column vectors

3 views (last 30 days)
Chaudhary P Patel
Chaudhary P Patel on 9 Apr 2022
Commented: Chaudhary P Patel on 19 Apr 2022
sir/madam i have two column vectors, i want to compare element by element and want to know which is large or small.
please help me, how can i write command for it.

Answers (1)

per isakson
per isakson on 9 Apr 2022
Edited: per isakson on 9 Apr 2022
An example
%%
v1 = rand( 6,1 );
v2 = rand( 6,1 );
%%
v1 > v2
ans = 6×1 logical array
1 0 0 1 1 1
This result tells us that the first, fourth, fifth and sixth element of v1 are larger than the corresponding elements of v2
  8 Comments
Chaudhary P Patel
Chaudhary P Patel on 19 Apr 2022
please @per isakson sir, suggest me how can i compare element by element?

Sign in to comment.

Categories

Find more on Loops and Conditional Statements 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!