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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:45:05+00:00 2026-05-25T03:45:05+00:00

I´m wondering how to get these in Matlab: a = 1 3 2 4

  • 0

I´m wondering how to get these in Matlab:

a = 
1 3
2 4
3 5
4 6
5 7
6 8
7 9
8 10
9 11
10 12

Really the structure I want to do has 2 thousand files. but I will start with something easier.
So I was thinking about to do it throught a loop:

for i=1:1:10
a(i) = [i i+2]
end

but this give an error:

???  In an assignment  A(I) = B, the number of elements in B and
I must be the same.

The idea is to generate a entire matrix (or structure, I suppose both are the same…) using a for loop (or may be there is a way to do it without any case of loop…).
Does anyone could tell me how to do it?
Thank you so much!

  • 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-25T03:45:05+00:00Added an answer on May 25, 2026 at 3:45 am

    In your for loop, you are assigning two numbers to one element of your array a. Try

    for i=1:1:10
      a(i,:) = [i i+2];
    end
    

    instead. Or, just use

    a=[(1:10)' (3:12)'];
    

    which replaces your loop…

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

Sidebar

Related Questions

I am wondering these files get generated when you make an asp.net mvc 3
I'm wondering how in MATLAB you can get a reference to a Java enum
Just wondering if anyone can let me know how I can get these three
Wondering if there is any way to get the lambda expressions that result from
Just wondering if there is any way to get the NS records in C#.
Just wondering if there is any way (in C) to get the contents of
I was wondering if there was somewhere I could get some starter kit /
I was wondering if there was a way to get at the raw HTTP
I'm wondering if there are any simple ways to get a list of all
I was wondering if there is a JOptionPane where you can get multiple inputs

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.