how do i create a loop that checks checks every column one row at a time in a matrix for a string called "nan" in matlab
main.m
% Sample matrixmatrix = ["hello", "world", "how"; "are", "you", "nan"; "today", "nan", "fine"];
% Get the size of the matrix[rows, cols] = size(matrix);
% Loop through each column and check for the string "nan" in each rowfori = 1:cols
forj = 1:rows
if strcmp(matrix(j, i), "nan")
disp(['Found "nan" at column ', num2str(i), ', row ', num2str(j)]);
endendend