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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:17:19+00:00 2026-06-04T15:17:19+00:00

I noticed what was for me an unpredicted behavior when evaluating vectors. It seems

  • 0

I noticed what was for me an unpredicted behavior when evaluating vectors. It seems is really different doing it directly than indexing within a loop. Can anyone give me some help with this?
i know is probably explained in how it makes each operation, so i need some keys about how to look for it

thanks for advise
thanks in advance

example:

x=[0.05:.01:3];
n=size(x,2);
y1 = (8*x-1)/(x)-(exp(x));

for i=1:n
    y2(i)=(8*x(i)-1)/(x(i))-(exp(x(i)));
end

a1=[x;y1];
a2=[x;y2];

plot(x,y1, 'red')
hold on
plot(x,y2, 'blue')

here the plot:
https://i.stack.imgur.com/qAHD6.jpg

results:

a2:
0.05   -13.0513
0.06   -9.7285
0.07   -7.3582
0.08   -5.5833
0.09   -4.2053
0.10   -3.1052
0.11   -2.2072
0.12   -1.4608
0.13   -0.8311
0.14   -0.2931
0.15   0.1715
0.16   0.5765




a1:
0.05   6.4497
0.06   6.4391
0.07   6.4284
0.08   6.4177
0.09   6.4068
0.10   6.3958
0.11   6.3847
0.12   6.3734
0.13   6.3621
0.14   6.3507
0.15   6.3391
0.16   6.3274
  • 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-04T15:17:21+00:00Added an answer on June 4, 2026 at 3:17 pm

    What you want is:

     y1 = (8*x-1)./(x)-(exp(x));   % note the ./
    

    instead of:

     y1 = (8*x-1)/(x)-(exp(x)); 
    

    As a side note, you can type help / to see what your original first statement was really doing. It was effectively doing (x'\(8*x-1)')' (note the backslash).

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

Sidebar

Related Questions

Noticed an interesting GUI based setting in MacVim, that seems useful but I can't
I noticed that Clojure (1.4) seems to be happy to consider vectors equal to
I noticed that i can set a return type on a function to 'Void'
I noticed that extjs comes with 3 to 4 default themes/skins . How can
Noticed Apache strange behavior. I'm using mod_rewrite to redirect every RewriteCond %{REQUEST_URI} !^.*css|gif|js|png$ RewriteRule
I noticed that most of the time, when using some encoding other than 'the
I noticed the other day that I can call boolean.class, but not integer.class (or
I noticed that 2147483647 seems to be a popular choice for maxReceivedMessageSize but is
I noticed that itertools does not (it seems to me) have a function capable
I noticed a peculiar behavior with NHibernate. Context: I have a table with a

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.