フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

A code that certifies me if my variable "n" is present in the first (left) column of a matrix

1 回表示 (過去 30 日間)
Marco Camozzi
Marco Camozzi 2020 年 4 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
Maybe someone can help me, I am looking for a code that certifies me if my variable "n" is present in the first (left) column of my matrix, the left column corresponds to all the starpoints of a grid of segments and I want to check if my "n" value corresponds to one of these values.
Edge = [1 2;
2 3;
3 4;
2 6;
3 7;
5 6;
6 7;
7 8];
[i,j]=size(Edge);

回答 (1 件)

KSSV
KSSV 2020 年 4 月 28 日
any(Edge(:,1)==n)

この質問は閉じられています。

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by