Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

cell-array

How do I detect empty cells in a cell array?

September 10, 2023 by Tarik

Use CELLFUN %# find empty cells emptyCells = cellfun(@isempty,a); %# remove empty cells a(emptyCells) = []; Note: a(i)==[] won’t work. If you want to know whether the the i-th cell is empty, you have to use curly brackets to access the content of the cell. Also, ==[] evaluates to empty, instead of true/false, so you … Read more

Categories matlab Tags cell-array, is-empty, matlab Leave a comment

How to search for a string in cell array in MATLAB?

December 31, 2022 by Tarik

I guess the following code could do the trick: strs = {‘HA’ ‘KU’ ‘LA’ ‘MA’ ‘TATA’} ind=find(ismember(strs,’KU’)) This returns ans = 2

Categories string Tags cell-array, matlab, string Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa