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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:52:37+00:00 2026-06-14T06:52:37+00:00

I cant find how to write the code so my Matlab script re-ask the

  • 0

I cant find how to write the code so my Matlab script re-ask the question since the user input was in wrong format.

My code is very simple and it all works but it just skips if the user gives wrong format for a second time. Is it possible in Matlab script to have the question repeated since a if fails and the input does not pass what is asked for?

  A1 = input('State the vector: ');
    if length(A1) < 3 || length(A1) > 3
    disp('The input needs 3 values.')
    A1 = input('State the vector again please: ');
  end

How do i make it ask the question untill it passes the length of index 3?

  • 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-14T06:52:38+00:00Added an answer on June 14, 2026 at 6:52 am

    Try this:

    A1 = input('State the vector: ');
    while(1)
        if length(A1) ~= 3
            disp('The input needs 3 values.');
            A1 = input('State the vector again please: ');
        else
            break;
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this might be a very simple question, but I could not find an answer
I setup the Netbeanss 7.1.1 and write the simple code below. But when I
I have 3 question about TransactionScopeOption.Required that driving me crazy and I cant find
I can't find any mention of the limitations on CoreBluetooth framework's read/write. Does anyone
I want to write an mmo game server, but I can't seem to find
Cant find the way to display friends, who achieve it, on achievement page. /USER_ID/achievements
I cant find good solution to get information from other mysql tables when I
I cant find an answer already on stackoverlow for this. This is the simplest
I cant find it in XCode 4.3.2. In previous versions of XCode it looked
I cant find one way to get this value (comment) into json using javascript.

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.