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 8991123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:39:13+00:00 2026-06-15T22:39:13+00:00

Earlier I got some help as to how to make a script that will

  • 0

Earlier I got some help as to how to make a script that will extract hashtags from a list of tweets and put them into an array of cells.
I used this as my code, inside a for loop

hashtagCell{i} = regexp(textRead{i}, '#[A-z]*', 'match');

This works for what it is supposed to do, but now I’m trying to find the average character length of the hashtags, so I need to be able to add the character length of each hashtag pulled out by the above function and add them together. However, when I try to use the size() function, it just gives me the size of the cell instead of the size of the strings, which is what I want. I can’t figure out how to do this.

  • 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-06-15T22:39:14+00:00Added an answer on June 15, 2026 at 10:39 pm

    This should help (and it gets rid of any loops, other than, perhaps, the one used to create CellOfText):

    %# Example cell array of tweets
    CellOfText = {'Bah #humbug says #Mr scrooge'; 'No #presents for you'};
    
    %# Get all hash tags
    HTC = regexp(CellOfText, '#[A-z]*', 'match');
    
    %# Get the average hash tag length, being careful to unnest HTC
    AvgLength1 = mean(cellfun('length', [HTC{:}]));
    

    DISCLAIMER: The inspiration for this method came from this excellent answer to a similar question. Thanks to @Andrey for that.

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

Sidebar

Related Questions

Hi I posted this earlier and got some help but still no working solution.
I got some help with this earlier today but I cannot figure out the
So I wanted to make a own custom mapper earlier but I got the
I've been trying to write a script that will sniff HTTP headers. So far
I have got an ASP page that does some back-end processing. It calls a
I've got a SWF that collects feedback from users on a website. The questions
Earlier I got some great advice about Client/server sockets in c . I have
I asked a question on here earlier and got some fantastic responses. I've since
I asked a question earlier yesterday and got some very good answers for sure.
I posted earlier about how to do this, and got some great replies, and

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.