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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:55:25+00:00 2026-05-28T05:55:25+00:00

I like MATLAB automatically linebreaking comments on a certain limit per line. Now let’s

  • 0

I like MATLAB automatically linebreaking comments on a certain limit per line. Now let’s assume I have added the following comment:

% a) this is a test comment. this is a test comment. this is a test comment
%    this is a test comment. this is a test comment. this is a test
%    comment! this is a test comment!

with a manual indentation at the beginning (to fit the a)). Now when I need to change a bit of the comment, e.g. inserting some words into the first line, the first line gets too long. How can I automatically get it newly formated to the correct max. line length but still with the manual indentation?
Is there any automatical way 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-05-28T05:55:26+00:00Added an answer on May 28, 2026 at 5:55 am

    I think that the best you can do requires three steps on your part.

    When you initially add some text, it looks like this:

    % a) this is a test comment. this is a test comment. ADDED TEXT this is a test comment
    %    this is a test comment. this is a test comment. this is a test
    %    comment! this is a test comment!
    

    First, select the text (or the whole file via CTRL+a) and then issue the “wrap comments” command using CTRL+J . Now your text looks like this:

    % a) this is a test comment. this is a test comment. ADDED TEXT this is a
    % test comment
    %    this is a test comment. this is a test comment. this is a test
    %    comment! this is a test comment!
    

    Second, you have to manually indent that first line, so the text looks like this:

    % a) this is a test comment. this is a test comment. ADDED TEXT this is a
    %    test comment
    %    this is a test comment. this is a test comment. this is a test
    %    comment! this is a test comment!
    

    Third, select text and use CTRL+J again. Your text will look like:

    % a) this is a test comment. this is a test comment. ADDED TEXT this is a
    %    test comment this is a test comment. this is a test comment. this is a
    %    test comment! this is a test comment!
    

    It’s not perfect, but it is as good as I am aware of within the Matlab editor.

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

Sidebar

Related Questions

I have a matlab GUI....I'd like to load ANY file type(doc,txt,dat,xls) into matlab as
I have a Matlab program that is running longer than I'd like it to.
Like the Delicious submission bookmark-let, I'd like to have some standard JavaScript I can
Say I have a string in a variable in MATLAB like the following: this
If I have an upper triangular matrix on MATLAB LIKE A = 1 2
I am trying to implement a simple matlab-like array (now only one dimension actually),
I would like to edit matlab scripts in two cases (1) In matlab Command
i would like to process infrared imaging in Matlab. Any kind of processing or
I would like to know how I can record a video in MATLAB with
I would like to construct a histogram with unequal bins (intervals)..Matlab construct only histograms

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.