필터 지우기
필터 지우기

How can extract values from array?

조회 수: 1 (최근 30일)
Aseel H
Aseel H 2011년 9월 13일
I have an array as X = [0 0 1 3;5 0 2 1;-1 0 1 7;0 1 8 3]; I wante extract the values that are 0's and 1's by the same order of them in X in other array such as Y = [0 0 1 0 1 0 1 0 1]
please reply for my question
thanks

채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 9월 13일
x1 = X'
x1 = x1(:)'
out = x1(x1 == 0 | x1 == 1)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by