Comparision of a matrix to a value

1 Ansicht (letzte 30 Tage)
Tina
Tina am 31 Okt. 2019
Kommentiert: Tina am 31 Okt. 2019
I want to compare values of a matrix of 4 by 3 dimension
for example
a=[7 8 8 ;5 3 2 ;1 2 3;7 6 5]
to a 1by1 matrix
b=[ 5]
if the values are greater than 5 the codes give me a 1 and 0 if not in a matrix of same dimension as a.What should i do??

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 31 Okt. 2019
Bearbeitet: KALYAN ACHARJYA am 31 Okt. 2019
a=[7 8 8 ;5 3 2 ;1 2 3;7 6 5];
b=5;
result=a>b

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by