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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:35:51+00:00 2026-06-05T19:35:51+00:00

I am looking to find the slope between two vectors via linear regression in

  • 0

I am looking to find the slope between two vectors via linear regression in Objective C or C (its for xcode). The equation I am attempting to mirror is implemented in matlab. (Info on it here: http://www.mathworks.com/help/techdoc/data_analysis/f1-5937.html)

In matlab the code looks something like this (from the documentation):

x =

11
 7
14
11
43
38
61
75
38
28
12
18
18
17
19
32
42
57
44
114
35
11
13
10

y =

11
13
17
13
51
46
132
135
88
36
12
27
19
15
36
47
65
66
55
145
58
12
9
9

Use polyfit to compute a linear regression that predicts y from x:

p = polyfit(x,y,1)

p =
    1.5229   -2.1911

p(1) is the slope and p(2) is the intercept of the linear predictor. 

I only need the “p(1)” part from an equation similar to this.

Is there a message/method from a framework somewhere that can compute something similar in a C language?

  • 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-05T19:35:53+00:00Added an answer on June 5, 2026 at 7:35 pm

    You can code up both the intercept and gradient from your data directly from the formulas here : they are not difficult at all to implement in C

    http://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line

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

Sidebar

Related Questions

I'm looking to find information on how to update my XCode program that has
I am looking to find a generic way to support keyboard wedge scanning for
I am looking to find the traffic through a specific port for a time
I am looking to find a way to programatically (C++) control/secure access to the
I'm looking to find something along the lines of Checkstyle for Visual Studio. I've
I'm looking to find a galleria replacement, hopefully using jQuery but other javascript frameworks
I'm looking to find the Javascript Event I need to put into jQuery's .bind
I am looking to find out if a web page has changed, I was
I am looking to find a why to calculate a suitable background colour and
I'm looking to find a way to round up to the nearest 500.I've been

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.