Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6799641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:52:21+00:00 2026-05-26T18:52:21+00:00

I have a cell array, x, and each row of which is a string

  • 0

I have a cell array, x, and each row of which is a string array.
For instance,

>>ab = x{2};
>>ab
ans =
  910        Flow’S Equation

Clearly, this string has a pattern: a numerical value and a text string are separated by some empty spaces. With respect to this example, when I type

>> ab(2)
  ans =
    1
>> ab(3)
  ans =
    0
>> ab(6)
  ans =
    F

In my code, I need automatically check the starting position of text string, which is the one for “F” and the end position of numerical value, which is the one for “0”. I use

>> x = strfind(ab, ' ');

For this example, I expect it give me the positions of “space” as

4 5 12

In stead, it just gives me 12 without outputing 4 and 5

I think the problem is that the fourth and fifth entries of ab are not “space”, How can I know what are they? When I type

>> ab(4)
 ans =

The output is nothing, just like what “space” is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:52:22+00:00Added an answer on May 26, 2026 at 6:52 pm

    To find out what char ab(4) is, convert the char to numerical form by

    double( ab(4) )
    

    For double(ab(4))=9, it’s a TAB. If your string is ASCII, you may want to check ASCII control characters and ASCII printable characters for the mapping.

    However, to find the beginning of the text string, using regexp may be a better idea:

    string_begin = min( regexp(ab, '[^\d\s]') )
    

    regexp(ab, '[^\d\s]') returns the locations of all characters that are neither numbers nor white spaces, and the minimum of the locations should be where the text begins.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looping through cells in a table row. each cell has a text box
I have a cell array where each element consists of a vector of ids.
So I have an array with objects which each have several attributes including an
I have a table of assignments. Within each row is a cell, that when
I have an array of dictionaries. Each dictionary has one category. I want to
I have three arrays, all the same size: xout % cell array xin %
You have: val array = new Array[Array[Cell]](height, width) How do you initialize all elements
This is kinda confusing so please bear with me. I have an array (listOfStates)
I have a large dataset split into 5 files (each has 15000 attributes, first
I have a DataGrid whose dataProvider is an Array of int Arrays (each with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.