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

  • SEARCH
  • Home
  • 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 6837507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:29:08+00:00 2026-05-26T23:29:08+00:00

If I have an input like [1 2 3; 4.0 c] and I want

  • 0

If I have an input like [1 2 3; 4.0 c] and I want it to output it like 1234.0c in matlab. What function can I use ? I am looking for something like trim in php.

Any idea ?
Thanks

  • 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-26T23:29:08+00:00Added an answer on May 26, 2026 at 11:29 pm

    You can use isstrprop function with approppriate categories. For your case,

    >> str = '1 2 3; 4.0 c';
    >> str(isstrprop(str, 'alphanum') | str == '.')
    
    ans =
    
    1234.0c
    

    You can use functions like isletter, isnumeric, etc. if you like.

    Besides, you can create your own function in one line as follows

    >> myTrim = @(x)(x(isstrprop(x, 'alphanum') | x == '.'));
    >> myTrim(str)
    
    ans =
    
    1234.0c
    

    Note that you ask [1 2 3; 4.0 c] as an input which is not a proper syntax for MATLAB. I assumed you wanted to ask for a string. In addition, trim actually implies removing leading and trailing white space from a string and there is strtrim for this in MATLAB.

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

Sidebar

Related Questions

I have an input like this RX Only : Gi1/0/15,Gi1/0/20,Gi1/0/17 I want to capture
I have a text input field like text box or text area. I want
i have two text inputs like the following, i don't want to use <form>
I have this use case of an xml file with input like Input: <abc
If I have a number like 12345, and I want an output of 2345,
I have an input XML document something like this: <text> <p> Download the software
I have a list of items in python something like this: input: a=['nt','mt','pt'] I
I have some input like this: aaaaa bbb \n cccccc\n ddddd \neeee And I
i have a input like this $desc = &lt;p&gt;\r\n test job description!&lt;/p&gt; i have
If I have an input file like: US, P1, AgriZone, H, 1000, 1200, 1101,

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.