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

  • Home
  • SEARCH
  • 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 6067333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:35:49+00:00 2026-05-23T09:35:49+00:00

Please help me write a MATLAB program that constructs a column matrix b ,

  • 0

Please help me write a MATLAB program that constructs a column matrix b, such that

b1 = 3x1 – 3/4y0
b2 = 3x2
…
bn-2 = 3xn-2
bn-1 = 3xn-1 – 3/4yn

where x and y are variables. Notice that y only appears in the first and last entries of b.

My problem is that I don’t know how variables work in MATLAB. I tried

b = 3*x

and it says

??? Undefined function or variable ‘x’

So, how do we create variables instead of constants?

Thanks!

  • 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-23T09:35:49+00:00Added an answer on May 23, 2026 at 9:35 am

    EDIT:

    From your comments above, what you need is MATLAB’s symbolic toolbox, which allows you to perform computations in terms of variables (without assigning an explicit value to them). Here’s a small example:

    syms x %#declare x to be a symbolic variable
    y=1+x;
    z=expand(y^2)
    
    z=
     
    x^2 + 2*x + 1
    

    You will need to use expand sometimes to get the full form of the polynomial, because the default behaviour is to keep it in its simplest form, which is (1+x)^2. Here’s another example to find the roots of a general quadratic

    syms a b c x
    y=a*x^2+b*x+c;
    solve(y)
    
    ans =
     
     -(b + (b^2 - 4*a*c)^(1/2))/(2*a)
     -(b - (b^2 - 4*a*c)^(1/2))/(2*a)
    

    I think you meant bn and xn in the last line… Anyway, here’s how you do it:

    b=3*x;
    b([1,end])=b([1,end])-3/4*y([1,end])
    

    You can also do it in a single line as

    b=3*x-3/4*[y(1); zeros(n-2,1); y(end)];
    

    where n is the length of your vector.

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

Sidebar

Related Questions

Please help! I'm really at my wits' end. My program is a little personal
Hi Guys could you please help me refactor this so that it is sensibly
java experts can you please help me write detached queries as a part of
Please help me write LINQ for this SQL select svc.SvcName, svcOptions.SvcOptionName, svcMap.Price from svcMap
Basically I have 14800x8 matrix that has been extracted from matlab as CSV file
Can someone please help me write the following, without using dot notation: self.bounds.size.width I
I need help to write a MySQL query that would do the following for
Can someone please help me understand how I would write this. If i am
Is there a better way to write this Ruby code? Please help to refactor.
Please help! Background info I have a WPF application which accesses a SQL Server

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.