How to get a logical output if all the arrays of a matrix are NAN and the matrix is a string

조회 수: 1 (최근 30일)
Hello
The matrix, F I have is:
F =
1×8 string array
"NA" "NA" "NA" "NA" "NA" "NA" "NA" "NA"
I want to write a line of code such that produce a logical value of 1 if all the arrays of F are NA.
How should I do this?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 9월 15일
F=["NA" "NA" "NA" "NA" "NA" "NA" "NA" "NA"];
all(F=="NA")
ans = logical
1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by