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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:35:23+00:00 2026-05-15T12:35:23+00:00

I wonder if matlab has set restriction on variable’s name. fixnb21=0; for fix=1:200 if

  • 0

I wonder if matlab has set restriction on variable’s name.

fixnb21=0;

for fix=1:200
    if fixdur(fix)>MIN_FIX_DUR && fixdur(fix)<MAX_FIX_DUR
        fixnb21              =fixnb21+1
        fixdur21(fixnb21)    =fixdur(fix) % I wonder if we are not allowed to add 21 at the end of variables or array name
        ...
    end
end

The fixnb21output is 113, which mean the total number of row of fixdur21 should be 113. But when I checked the number of rows of fixdur21, it was 1023, which is totally wrong. This only happen when I put the number 21 at the end of fixdur21. The output seems right when I don’t use the number 21. this is so confusing.

  • 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-15T12:35:23+00:00Added an answer on May 15, 2026 at 12:35 pm

    try starting with fixdur21=[].

    if that doesnt work post the rest of your code! – you must be changing it somewhere else

    variables names can contain any digits you like (except at the start)
    though if you have several numbered variables, you are probably better off using a list or cell array (so you can iterate over them).

    also, your whole code simplifies to:

    fixdur21 = fixdur((fixdur(1:200) > MIN_FIX_DUR) & (fixdur(1:200) < MAX_FIX_DUR));
    fixnb21  = length(fixdur21);
    

    and you can omit the 1:200 if fixdur is always 200 items long

    don’t iterate if you don’t have to.

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

Sidebar

Related Questions

I wonder when saving plot into image file in matlab, what is the difference
I wonder how to get quotient in integer division in MATLAB? Thanks and regards!
I just wonder how to add annotation in matlab plot? Here is my code:
I wonder what is the difference between annotation() and text() functions in Matlab? In
I wonder in MATLAB how I would plot a circle and show it correctly
I'm new at Matlab. You may find this question silly but I really wonder
I often hear people complain how expensive MATLAB licenses are. Then I wonder why
For my work I have to set up a project in Matlab, which is
Hey there, I'm currently developing a Mex-file in matlab including CUDA computation. I wonder
I wonder if there's a simpler and nicer solution to toggle a variable between

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.