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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:23:42+00:00 2026-06-11T02:23:42+00:00

In a tutorial I was running today, the following problem came up a few

  • 0

In a tutorial I was running today, the following problem came up a few times.

The code was something like this

x = [ x0 + v*cosd(theta) * t, y0 + v*sind(theta) * t + .5 *g * t^2]

However, when you output x, it had 3 entries with a zero before the two calculated values. I have no idea how that happened. I restyled the same code exactly and this problem disappeared. Could this be some sort of bug with MATLAB?

  • 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-11T02:23:44+00:00Added an answer on June 11, 2026 at 2:23 am

    In matlab if you combine a vector with a scalar the resulting value is a vector. For example:

    a = 1;
    b = [1, 2];
    c = a+b; % returns [2, 3];
    

    So lets break down your equation:

     x = [ x0 + v*cosd(theta) * t, y0 + v*sind(theta) * t + .5 *g * t^2]
    

    into:

    A = x0 + v*cosd(theta) * t;
    B = y0 + v*sind(theta) * t + .5 *g * t^2;
    x = [ A, B];
    

    A and B must both be scalars for x to be 1x2. Your result is 1×3 because one of your variables because either A or B is 1×2. This is the result of x0, v, theta, t, y0, or g not being a scalar but a 1x2 vector.

    My suspicion is that g, x0, or y0, is the culprit as these variables are unique to a single equation. So I’d start by checking the size of these values. However without knowing the values of your variables I can’t be sure.

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

Sidebar

Related Questions

Following this tutorial and running into trouble. [TestMethod] [ExpectedException(typeof(Exception))] public void VerifyPropertyNameMethod_NonExistentPropertyString_ThrowsException() { var
I'm following this tutorial: http://developer.android.com/training/basics/firstapp/running-app.html#Emulator In it there is a simple code for a
I am following this tutorial http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/ note: yes I know I did install hadoop
I am running through a tutorial and even though I have typed this code
I'm following this tutorial on running Codeigniter via the CLI. I've done everything they've
I'm running this Java + SSL Tutorial , but I'm getting the following error.
I'm running through this tutorial found here: http://vb.net-informations.com/crystal-report/vb.net_crystal_report_from_multiple_tables.htm which teaches how to pass a
I'm running 32-bit Windows 7 Enterprise and CodeBlocks 10.05. I followed this tutorial to
Hi guys I'm running through this tutorial: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap and trying to get the code
I am following the tutorial for py2exe from this site http://www.py2exe.org/index.cgi/Tutorial this is the

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.