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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:29:48+00:00 2026-06-15T22:29:48+00:00

I have the following data: ET = [1 3 5 7 6 4] ,

  • 0

I have the following data: ET = [1 3 5 7 6 4], and below is my code:

for i=1:3
    meanET(i)=ET(:,1+(2*i-2)); %//for i=1,extract ET column 1 data
    stdET(i)=ET(:,2+(2*i-2)); 
    totalET(i)=meanET(i)+stdET(i)
end

However, MATLAB display’s an error that says that in the assignment A(I)=B, the number of elements in B and I must be the same, and therefore I modified my code to this:

for i=1:3
    meanET=ET(:,1+(2*i-2));%for i=1,extract ET column 1 data
    stdET=ET(:,2+(2*i-2)); 
    totalET=meanET+stdET
end

After running the latter code, it showed meanET=6, stdET=4, and totalET=10, which means that it only stored the data for i=3 in the workspace. I want to get the result like
totalET=[4 12 10] in the workspace, corresponding to i = 1, 2, 3. How do I do that?

  • 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-15T22:29:49+00:00Added an answer on June 15, 2026 at 10:29 pm

    you should just declare your target array at the beginning of your code:

    meanET=zeros(size(ET,1),3);
    stdET=zeros(size(ET,1),3);
    for i=1:3
       meanET(:,i)=ET(:,1+(2*i-2));
       stdET(:,i)=ET(:,2+(2*i-2)); 
    end
    totalET=meanET+stdET
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
hi i have the following code below, where i try to get all the
I have the following SQL design issue. The code below might look a little
I have the following code below: $('<td>').append($('<input>').attr({ type: 'text', readonly: 'readonly', value: currentSet.weight }));
Here i have the following code below :- public class OrderActivity extends ListActivity implements
I have the following ASP.NET (VB) code below. My goal is to get the
I have the following code to fetch the data from URL, store it in
I have the following in my App.config, how do I make the code below
I have the following code below to generate an OpenSSL RSA public and private
I have the following code snippet that builds chained select boxes based on data

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.